Forum Replies Created
-
AuthorPosts
-
SteveKeymaster@upside– Always great to hear from Piklist fans!
scopedoes a lot, but in simplest terms, it tells Piklist where to save data."scope" => "post": saves to wp_post table
"scope" => "page": does nothing since the table doesn’t exist.In your case, the editor field is actually post_meta:
"scope" => "post_meta"Or if you’re in the admin you can just leave it out since Piklist is smart enough to figure it out.
SteveKeymastergreat. glad you got it working.
setting the
scopeparameter on front end forms is mandatory so Piklist knows where to save the data.July 15, 2016 at 9:08 am in reply to: [functional bug] single image not working after it's removed from media #6950
SteveKeymaster@pionect– We’re aware of this issue and it’s something on our list of todo’s. Sorry for the inconvenience.
SteveKeymaster@semwangajoshua– Sorry you’re having issues. Since you’re the only one reporting this I’m guessing this has to do with your server setup or a conflicting plugin/theme. Did you try deactivating other plugins and switching to the WordPress default theme?
SteveKeymaster@bshep– You could save the field as a
groupfield, with the checkbox field being the only field in the group.OR
You can just leave it the way it is, and use
get_post_meta()with the last parameter set tofalse. This would give you the data back as an array:get_post_meta(get_the_ID(), 'my_field', false)Piklist saves it like this because the data is flexible. If you want to query on the data you can. Saving it as a serialized array removes the ability to query it.
SteveKeymasterThat’s odd. When I use that field, pull the value and use in an equation it works for me.
SteveKeymasterWow! What a find. I updated the local repo for the next major release.
Thanks!
SteveKeymaster@hartey11– Piklist supports are HTML5 fields, including
number:piklist('field', array( 'type' => 'number' ,'field' => 'my_number' ,'label' => 'Enter a number' ));
SteveKeymasterLooks good!
SteveKeymasterPerfect!
Since Piklist does everything the WordPress and PHP way, that code will work on any array. Not just Piklist.
Closing ticket.
SteveKeymasterLooks like
$stmp_postn1_vsbis an array. To see the value use print_r instead of echo: print_r($stmp_postn1_vsb);To use it you will need to loop over the array using foreach.
SteveKeymaster@amristar– Welcome to the Piklist community!
You can use the WordPress function get_term_meta().
SteveKeymasterI just tried hooking to these functions, and the field renders but it doesn’t save.
Looks like a bug. I’ll put in a ticket for it but it may take a while.
SteveKeymaster@morganrt– You don’t need to drop in a shortcode, you can just use a Piklist field. I’m not exactly sure which hook to use, but the function can look like this:
function extra_comment_fields() { piklist('field', array( 'type' => 'text' ,'field' => 'my_label' ,'scope' => 'comment_meta' ,'label' => 'My label' )); }This can go in your functions.php file.
Let us know if this works for you and which hook you ended up using.
SteveKeymasterSo, glad it’s working. Please review them… you were close 😉
Closing this ticket.
-
AuthorPosts