Changeset 1448137
- Timestamp:
- 07/03/2016 05:21:41 PM (10 years ago)
- Location:
- advanced-custom-fields-tag-it/trunk
- Files:
-
- 3 deleted
- 3 edited
-
acf-tag-it.php (modified) (1 diff)
-
css (deleted)
-
field.php (modified) (1 diff)
-
images (deleted)
-
js (deleted)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-custom-fields-tag-it/trunk/acf-tag-it.php
r1232241 r1448137 4 4 Plugin Name: Advanced Custom Fields: Tag It 5 5 Plugin URI: https://wordpress.org/plugins/advanced-custom-fields-tag-it/ 6 Description: The jQuery UI Tag It field for ACF7 Version: 1.0.06 Description: A tag-it field for ACF 7 Version: 2.0.0 8 8 Author: Brian Reed 9 9 Author URI: iambrian.com -
advanced-custom-fields-tag-it/trunk/field.php
r1232241 r1448137 1 1 <?php 2 class acf_field_tag_it extends acf_field 3 { 4 function __construct() 5 { 2 3 class acf_field_tag_it extends acf_field { 4 5 function __construct() { 6 6 7 $this->name = 'tag-it'; 7 $this->label = __( 'Tag It', 'acf-tag-it');8 $this->label = __( 'Tag It', 'acf-tag-it' ); 8 9 $this->category = 'basic'; 9 10 $this->defaults = array(); 10 11 $this->l10n = array( 11 'error' => __( 'Error! Please enter a higher value', 'acf-tag-it')12 'error' => __( 'Error! Please enter a higher value', 'acf-tag-it' ) 12 13 ); 14 13 15 parent::__construct(); 14 16 } 15 function render_field_settings($field) 16 { 17 acf_render_field_setting($field, array( 18 'label' => __('Available Tags', 'acf-tag-it'), 19 'instructions' => __("Used as source for autocompletion, unless source is overridden.<br><br>Enter each choice on a new line.", 'acf-tag-it'), 20 'type' => 'textarea', 21 'name' => 'available_tags' 22 )); 17 18 function render_field_settings( $field ) { 19 20 acf_render_field_setting( $field, array( 21 'label' => __( 'Available Tags', 'acf-tag-it' ), 22 'instructions' => __( "Used as source for autocompletion, unless source is overridden.<br><br>Enter each choice on a new line.", 'acf-tag-it' ), 23 'type' => 'textarea', 24 'name' => 'available_tags' 25 ) ); 23 26 } 24 function render_field($field) 25 { 26 ?> 27 <input id="<?php 28 echo esc_attr($field['id']); 29 ?>" type="text" name="<?php 30 echo esc_attr($field['name']); 31 ?>" value="<?php 32 echo esc_attr($field['value']); 33 ?>" style="font-size:<?php 34 echo $field['font_size']; 35 ?>px;" class="acf-tag-it" /> 36 <script>window[<?php 37 echo "'$field[id]_tagit_settings'"; 38 ?>] = { 39 'availableTags' : <?php 40 echo json_encode(explode("\n", $field['available_tags'])); 41 ?> 42 }; 27 28 function try_json_decode( $string ) { 29 30 $value = json_decode( $string ); 31 32 return (object) array( 33 'value' => $value, 34 'success' => ( json_last_error() == JSON_ERROR_NONE ) 35 ); 36 } 37 38 function render_field( $field ) { 39 $options = json_encode( array_map( 'trim', explode( "\n", $field['available_tags'] ) ) ); 40 41 ?> 42 <input id="<?php echo esc_attr( $field['id'] ); ?>" 43 type="text" 44 class="acf-tag-it" 45 name="<?php echo esc_attr( $field['name'] ); ?>" 46 value="<?php echo esc_attr( $field['value'] ); ?>" 47 style="width: 100%" 48 /> 49 <script> 50 jQuery('#<?php echo $field['id']; ?>').select2({tags: <?php echo $options; ?>}); 43 51 </script> 44 52 <?php 45 53 } 46 function input_admin_enqueue_scripts()47 {48 $dir = plugin_dir_url(__FILE__);49 wp_enqueue_script('acf-input-tag-it', "{$dir}js/input.js", array(50 'jquery-ui-autocomplete'51 ));52 wp_enqueue_style('acf-input-tag-it', "{$dir}css/input.css");53 }54 54 } 55 55 56 new acf_field_tag_it(); -
advanced-custom-fields-tag-it/trunk/readme.txt
r1232241 r1448137 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 The jQuery UI Tag It field for ACF10 The Tag It field for ACF using ACF 5's built-in Select2 library. 11 11 12 12 == Description == 13 13 14 Do you need to be able to select multiple bits of text but a repeater field is overkill? Use the Tag It field. This plugin brings Alex Ehlke's Tag It Field to ACF.14 Do you need to be able to select multiple bits of text but a repeater field is overkill? Use the tag-it field. This plugin brings uses ACF 5's built-in Select2 library. 15 15 16 16 This field currently includes the following options: … … 18 18 * available tags : Used as source for the autocompletion. 19 19 20 The original jQuery UI plugin can be found here: https://github.com/aehlke/tag-it 20 The jQuery UI plugin used in the first version of this plugin can be found here: https://github.com/aehlke/tag-it 21 The Select2 library used in ACF 5 can be found here: http://select2.github.io/select2/ 21 22 22 23 = Compatibility = … … 36 37 = 1.0.0 = 37 38 * Initial Release. 39 40 = 2.0.0 = 41 * Removed old tag-it library and replaced with Select2 library. Fixed font_size issue: @JoelStransky
Note: See TracChangeset
for help on using the changeset viewer.