Forum Replies Created
-
AuthorPosts
-
sancreativeMemberThe code im using is below,
I’ve stripped out the condition: update so i can get the addmore working firstpiklist('field', array( 'type' => 'group' ,'field' => 'workout_schedule' ,'label' => __('Tasks') ,'columns' => 12 ,'add_more' => true ,'fields' => array( array( 'type' => 'select' ,'field' => 'day' ,'columns' => 12 ,'choices' => array( 'monday' => 'Monday' ,'tuesday' => 'Tuesday' ,'wednesday' => 'Wednesday' ,'thursday' => 'Thursday' ,'friday' => 'Friday' ,'saturday' => 'Saturday' ,'sunday' => 'Sunday' ) ), array( 'type' => 'text' ,'field' => 'workout_schedule:my_field' ,'label' => 'Show/Hide Field' ,'description' => 'This field is updated by the Select field above' ), ) ));the saving issue starts when I add workout_schedule: to the text
sancreativeMemberthanks for the code example, works perfect.
I was using the latest beta version Piklist v0.9.9.6
sancreativeMemberThis works:
$options = get_option('piklist_demo_fields'); echo _('1st Street Address: ') . $options['global_headings_style_group']['ungrouped_address_1'][0] . ' '; echo _('PO Box, Suite, etc.: ') . $options['global_headings_style_group']['ungrouped_address_2'][0];Thank you for your help Steve, Much appreciated.
sancreativeMembersorry another typo correct code below
<?php /* Title: Field Groups Setting: piklist_demo_fields Tab: Groups Tab Order: 40 Order: 30 */ piklist('field', array( 'type' => 'group' ,'label' => '1st Address (Un-Grouped)' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'ungrouped_address_1' ,'label' => '1st Street Address' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => 'ungrouped_address_2' ,'label' => 'PO Box, Suite, etc.' ,'columns' => 12 ) ) )); piklist('field', array( 'type' => 'group' ,'label' => '2nd Address (Un-Grouped)' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'new_ungrouped_address_1' ,'label' => '2nd Street Address' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => 'new_ungrouped_address_2' ,'label' => '2nd PO Box, Suite, etc.' ,'columns' => 12 ) ) )); piklist('shared/code-locater', array( 'location' => __FILE__ ,'type' => 'Meta Box' )); ?>
sancreativeMemberSorry my fault for pasting the previous code in a hurry.
I’ve tried this in a brand new install using the latest version of piklist and the demo’s enabled.
the code i used is a modified version of piklist-demo group tab in settings
please let me know if this works for you?<?php /* Title: Field Groups Setting: piklist_demo_fields Tab: Groups Tab Order: 40 Order: 30 */ piklist('field', array( 'type' => 'group' ,'label' => '1st Address (Un-Grouped)' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'ungrouped_address_1' ,'label' => '1st Street Address' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => 'ungrouped_address_2' ,'label' => 'PO Box, Suite, etc.' ,'columns' => 12 ) ) )); piklist('field', array( 'type' => 'group' ,'label' => '2nd Address (Un-Grouped)' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'new_ungrouped_address_1' ,'label' => '2nd Street Address' ,'columns' => 12 ) ,array( 'type' => 'text' ,'field' => '2nd new_ungrouped_address_2' ,'label' => 'PO Box, Suite, etc.' ,'columns' => 12 ) ) )); piklist('shared/code-locater', array( 'location' => __FILE__ ,'type' => 'Meta Box' )); ?>
sancreativeMemberIt works if I only want one ungrouped group on one settings page
if i add two to the same page it renders the 2nd and not the 1st.piklist('field', array( 'type' => 'group' ,'label' => '1st' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'custom_h1' ,'label' => 'H1 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h2' ,'label' => 'H2 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h3' ,'label' => 'H3 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h4' ,'label' => 'H4 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h5' ,'label' => 'H5 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ) )); piklist('field', array( 'type' => 'group' ,'label' => '2nd' ,'description' => 'An Un-grouped field. Data is saved as individual meta and is searchable.' ,'fields' => array( array( 'type' => 'text' ,'field' => 'custom_h1' ,'label' => 'H1 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h2' ,'label' => 'H2 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h3' ,'label' => 'H3 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h4' ,'label' => 'H4 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ,array( 'type' => 'text' ,'field' => 'custom_h5' ,'label' => 'H5 Size' ,'description' => 'class="regular-text"' ,'help' => 'You can easily add tooltips to your fields with the help parameter.' ,'columns' => 2 ) ) ));
sancreativeMemberIt would be easier if i could just display them without having to group the fields to get them to show.
but whenever I ungroup the fields it will only display the last ‘ungrouped’ group
not sure if this is a bug or if there is a way around this – ive tried absolutely everything with the options to get them to show.
sancreativeMemberthat works thanks,
I’ve got another unrelated question will start a new thread
-
AuthorPosts