Tagged: conditions, groups, settings
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by
Steve.
-
AuthorPosts
-
-
January 15, 2016 at 1:23 pm #5629
notanameMemberIf at least one field should be hidden by condition in group field whole metabox not displayed in Setting page, for Page its work well:
piklist/parts/settings/hf-settings.php:
<?php /* Title: Header and Footer settings Setting: hf_settings */ piklist('field', array( 'type' => 'group' ,'field' => 'fruit_settings' ,'label' => __('Settings') ,'add_more' => true ,'fields' => array( array( 'type' => 'select' ,'field' => 'country' ,'label' => 'Country' ,'columns' => 12 ,'choices' => array( 'US' => 'United States' ,'EU' => 'European Union' ) ) ,array( 'type' => 'select' ,'field' => 'fruits' ,'label' => 'Fruits' ,'columns' => 12 ,'choices' => array( 'apples' => 'Apples' ,'oranges' => 'Oranges' ) ) ,array( 'type' => 'select' ,'field' => 'apples' ,'label' => 'Apples' ,'columns' => 12 ,'choices' => array( 'aceymac' => 'Aceymac Apple' ,'akero' => 'Akero Apple' ) ,'conditions' => array( array( 'field' => 'fruit_settings:fruits' ,'value' => 'apples' ) ) ) ,array( 'type' => 'select' ,'field' => 'oranges' ,'label' => 'Oranges' ,'columns' => 12 ,'choices' => array( 'blood' => 'Blood Orange' ,'navel' => 'Navel Orange' ) ,'conditions' => array( array( 'field' => 'fruit_settings:fruits' ,'value' => 'oranges' ) ) ) ) ));Code in function.php
add_filter('piklist_admin_pages', 'piklist_theme_setting_pages'); function piklist_theme_setting_pages($pages) { $pages[] = array( 'page_title' => __('Header Footer settings') ,'menu_title' => __('Header and Footer', 'piklist') ,'sub_menu' => 'themes.php' //Under Appearance menu ,'capability' => 'manage_options' ,'menu_slug' => 'custom_settings' ,'setting' => 'hf_settings' ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'single_line' => true ,'default_tab' => 'Basic' ,'save_text' => 'Save' ); return $pages; } -
January 15, 2016 at 3:42 pm #5631
notanameMemberIt is bug or need additional parameter in some field?
-
January 16, 2016 at 4:51 am #5639
notanameMemberCan anybody confirm this? Just try code above. In custom Setting page metabox should blink after booting and disapeer, if comment this code:
,'conditions' => array( array( 'field' => 'fruit_settings:fruits' ,'value' => 'apples' ) )fields showing normal, if select oranges, meta disapeering.
For Page, Post work normal. -
January 18, 2016 at 6:24 am #5655
notanameMemberSteve, please, check this case, really need your help. Sorry for multipost.
-
January 18, 2016 at 2:59 pm #5656
notanameMemberOk, after upgrade Piklisk to 0.9.9 (https://piklist.com/2015/10/06/piklist-v0-9-9-public-beta-and-next-steps/), code above started working, also in this version field ‘editor’ witch ‘add_more’ work correct.
-
January 18, 2016 at 5:39 pm #5658
-
-
AuthorPosts
- The topic ‘If at least one field should be hidden by condition whole metabox not displayed’ is closed to new replies.