├── README.md ├── readme.txt ├── acf-unique_id.php └── acf-unique_id-v5.php /README.md: -------------------------------------------------------------------------------- 1 | # Advanced Custom Fields: Unique ID Field 2 | 3 | Create a unique ID to easily identify repeater field's rows. 4 | 5 | ----------------------- 6 | 7 | ## Description 8 | 9 | Create a unique ID to easily identify repeater field's rows. The field is fulfill on the first "save" of the post. 10 | 11 | ### Compatibility 12 | 13 | This ACF field type is compatible with: 14 | * ACF 5 15 | 16 | ## Installation 17 | 18 | 1. Copy the `acf-unique_id` folder into your `wp-content/plugins` folder 19 | 2. Activate the Unique ID plugin via the plugins admin page 20 | 3. Create a new field via ACF and select the Unique ID type 21 | 22 | ## Changelog 23 | Please see `readme.txt` for changelog 24 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Advanced Custom Fields: Unique ID Field === 2 | Contributors: KLicheR 3 | Tags: acf,unique,id 4 | Requires at least: 3.5 5 | Tested up to: 4.0.1 6 | Stable tag: 1.0.0 7 | License: GPLv2 or later 8 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 | 10 | Create a unique ID to easily identify repeater field's rows. 11 | 12 | == Description == 13 | 14 | Create a unique ID to easily identify repeater field's rows. The field is fulfill on the first "save" of the post. 15 | 16 | **Compatibility** 17 | 18 | This ACF field type is compatible with: 19 | 20 | * ACF 5 21 | 22 | == Installation == 23 | 24 | 1. Copy the `acf-unique_id` folder into your `wp-content/plugins` folder 25 | 2. Activate the Unique ID plugin via the plugins admin page 26 | 3. Create a new field via ACF and select the Unique ID type 27 | 28 | == Changelog == 29 | 30 | = 1.0.0 = 31 | 32 | * Initial Release. -------------------------------------------------------------------------------- /acf-unique_id.php: -------------------------------------------------------------------------------- 1 | name = 'unique_id'; 25 | 26 | 27 | /* 28 | * label (string) Multiple words, can include spaces, visible when selecting a field type 29 | */ 30 | 31 | $this->label = __('Unique ID', 'acf-unique_id'); 32 | 33 | 34 | /* 35 | * category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME 36 | */ 37 | 38 | $this->category = 'layout'; 39 | 40 | 41 | /* 42 | * l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via: 43 | * var message = acf._e('unique_id', 'error'); 44 | */ 45 | 46 | $this->l10n = array( 47 | ); 48 | 49 | 50 | // do not delete! 51 | parent::__construct(); 52 | 53 | } 54 | 55 | 56 | /* 57 | * render_field() 58 | * 59 | * Create the HTML interface for your field 60 | * 61 | * @param $field (array) the $field being rendered 62 | * 63 | * @type action 64 | * @since 3.6 65 | * @date 23/01/13 66 | * 67 | * @param $field (array) the $field being edited 68 | * @return n/a 69 | */ 70 | function render_field( $field ) { 71 | ?> 72 | 73 |