Forum Replies Created
-
AuthorPosts
-
SteveKeymasterYou’re very welcome. Closing ticket.
SteveKeymasterYup… that’s a bug!
Try this:
$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]; piklist('field', array( 'type' => 'group' ,'field' => 'global_headings_style_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' ,'field' => 'global_headings_style_group_2' ,'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 ) ) ));
SteveKeymasterThat’s because the field names in the two groups are the same. This is not a Piklist requirement, this is a requirement of standard forms.
Make sure each field name is unique, and it should work fine.
SteveKeymasterYou can remove
'field' => 'global_headings_style_group', if you want and the other fields will save as normal. Let us know if that works for you.
SteveKeymasterGreat. Closing ticket.
SteveKeymasterGreat! Closing ticket.
SteveKeymaster@di_create– Welcome to the Piklist community!
Since Piklist does everything the WordPress way, you can easily use standard WordPress hooks/filters. I recommend you look at:
update_option
updated_option
update_option_{$option}Let me know if that works for you.
SteveKeymaster@zentala– Welcome to the Piklist community!
We can’t reproduce that error. Would appreciate if you could help out. Please deactivate all plugins except Piklist and see if you still have issue. If not, then activate one by one until you can narrow it down.
Let us know what you find.
SteveKeymaster@ajayphp– You would use a combination of the
context,priorityandorderparameters >
SteveKeymaster@ajayphp– I don’t think this is a Piklist thing. Wouldn’t you use
wp_dequeue_scriptto remove the new version, and then enqueue the old?
SteveKeymaster@craigburleigh— You can’t upload PHP files. Please zip up and email to [email protected]
SteveKeymaster@ajayphp– Great find! This is fixed in WP Helpers v1.7.1, which is now on WordPress.org >
Always happy to accept contributions. Currently, we accept SVN patches. Just email them to [email protected]
Also, leaving a 5 Star review for WP Helpers is another way to contribute. 😉
SteveKeymaster@craigburleigh– Welcome to the Piklist community!
I can’t reproduce your errors. Is there any other code in spectrum-start.php?
SteveKeymasterHere’s something that should get you started. It can definitely be improved. Like passing multiple args, but this is the quick version.
Place this function in your main plugin file, or your themes functions.php file. This is where you can define all your field types.
function my_get_field($field, $prefix = null) { switch ($field) { case 'my_first_field': $field = array( 'type' => 'radio' ,'field' => $prefix . $field ,'label' => __('First Field') ,'choices' => array( 'one' => 'One' ,'two' => 'Two' ,'three' => 'Three' ) ); break; case 'my_second_field': $field = array( 'type' => 'text' ,'field' => $prefix . $field ,'label' => __('Second Field') ); break; default: return; break; } return $field; }Then call it from your parts folder:
piklist('field', my_get_field('my_first_field', 'my_prefix_'));Let me know if that works for you.
-
AuthorPosts