Changeset 1397714
- Timestamp:
- 04/17/2016 12:20:06 PM (10 years ago)
- Location:
- acf-accordion/trunk
- Files:
-
- 3 edited
-
acf-accordion.php (modified) (1 diff)
-
js/input.js (modified) (4 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-accordion/trunk/acf-accordion.php
r1259199 r1397714 5 5 Plugin URI: http://bogdandragomir.com/acf-accordion 6 6 Description: An accordion field that lets you group multiple fields under accordion tabs. This makes a long ACF form break down with style. 7 Version: 1.1. 07 Version: 1.1.1 8 8 Author: Bogdan Dragomir 9 9 Author URI: http://bogdandragomir.com -
acf-accordion/trunk/js/input.js
r1259199 r1397714 1 1 (function($){ 2 3 2 3 4 4 function initialize_field( $el ) { 5 5 6 6 //$el.doStuff(); 7 7 8 8 } 9 10 9 10 11 11 if( typeof acf.add_action !== 'undefined' ) { 12 12 13 13 /* 14 * ready append (ACF5)15 *16 * These are 2 events which are fired during the page load17 * ready = on page load similar to $(document).ready()18 * append = on new DOM elements appended via repeater field19 *20 * @type event21 * @date 20/07/1322 *23 * @param $el (jQuery selection) the jQuery element which contains the ACF fields24 * @return n/a25 */26 14 * ready append (ACF5) 15 * 16 * These are 2 events which are fired during the page load 17 * ready = on page load similar to $(document).ready() 18 * append = on new DOM elements appended via repeater field 19 * 20 * @type event 21 * @date 20/07/13 22 * 23 * @param $el (jQuery selection) the jQuery element which contains the ACF fields 24 * @return n/a 25 */ 26 27 27 acf.add_action('ready', function( $el ){ 28 28 29 29 // search $el for fields of type 'accordion' 30 30 acf.get_fields({ type : 'accordion' }, $el).each(function(){ 31 31 32 32 initialize_field( $(this) ); 33 $(this).nextUntil(". field_type-tab, .acf-field-accordion").wrapAll('<div class="acf-accordion-group"></div>');33 $(this).nextUntil(".acf-field-tab, .acf-field-accordion").wrapAll('<div class="acf-field acf-accordion-group"></div>'); 34 34 }); 35 35 36 36 $(".acf-field-accordion").click(function () { 37 37 var toggler = $(this); … … 40 40 toggler.next(".acf-accordion-group").removeClass("opened"); 41 41 } else { 42 $(".acf-field-accordion.opened").removeClass('opened') ;43 toggler.addClass('opened') ;44 $(".acf-accordion-group.opened").removeClass("opened");45 toggler.next(".acf-accordion-group").addClass("opened");42 $(".acf-field-accordion.opened").removeClass('opened').next(".acf-accordion-group").removeClass("opened"); 43 toggler.addClass('opened').next(".acf-accordion-group").addClass("opened").children('.acf-field').each(function(){ 44 $(this).removeClass('hidden-by-tab'); 45 });; 46 46 refresh_fields_google_map(); 47 47 } … … 63 63 64 64 }); 65 66 65 66 67 67 } else { 68 69 68 69 70 70 /* 71 * acf/setup_fields (ACF4)72 *73 * This event is triggered when ACF adds any new elements to the DOM.74 *75 * @type function76 * @since 1.0.077 * @date 01/01/1278 *79 * @param event e: an event object. This can be ignored80 * @param Element postbox: An element which contains the new HTML81 *82 * @return n/a83 */84 71 * acf/setup_fields (ACF4) 72 * 73 * This event is triggered when ACF adds any new elements to the DOM. 74 * 75 * @type function 76 * @since 1.0.0 77 * @date 01/01/12 78 * 79 * @param event e: an event object. This can be ignored 80 * @param Element postbox: An element which contains the new HTML 81 * 82 * @return n/a 83 */ 84 85 85 $(document).on('acf/setup_fields', function(e, postbox){ 86 86 87 87 $(postbox).find('.field[data-field_type="accordion"]').each(function(){ 88 88 89 89 initialize_field( $(this) ); 90 90 $(this).nextUntil(".field_type-tab, .field_type-accordion").wrapAll('<div class="acf-accordion-group"></div>'); 91 91 92 92 }); 93 93 94 94 jQuery(".field_type-accordion").on('click', function () { 95 95 var toggler = $(this); … … 119 119 } 120 120 } 121 122 }); 121 122 }); 123 123 } 124 124 })(jQuery); -
acf-accordion/trunk/readme.txt
r1263763 r1397714 4 4 Tags: acf, accordion, advanced custom fields, tabs, options 5 5 Requires at least: 3.5 6 Tested up to: 4. 3.16 Tested up to: 4.5 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 14 14 15 15 The ACF Accordion provides an easy way to organize big forms by grouping the fields in accordion tabs. It works with horizontal tabs and it also supports WordPress icons. 16 17 Please contribute here 18 https://github.com/bvdr/acf-accordion 16 19 17 20 = Compatibility = … … 30 33 4. Please refer to the description for more info regarding the field type settings 31 34 35 ### Including it in theme 36 37 ACF Accordion can be included in the theme by using the `acf/accordion/dir` filter. Here is an example 38 39 ```php 40 include_once( 'includes/acf-accordion/acf-accordion.php' ); 41 42 add_filter( 'acf/accordion/dir', 'acf_accordion_dir' ); 43 function acf_accordion_dir( $dir ) { 44 $dir = get_template_directory_uri() . '/includes/acf-accordion/'; 45 return $dir; 46 } 47 ``` 48 32 49 == Screenshots == 33 50 … … 36 53 == Changelog == 37 54 38 = 1.1.1 =39 * [Fix] icons path not working when plugin is included in theme;55 = 1.1.1 - April 17, 2016 = 56 * [Fix] multi tabs not working with accordion, tab after accordions showing empty; 40 57 41 58 = 1.1.0 =
Note: See TracChangeset
for help on using the changeset viewer.