Tagged: editor field, Shortcode
- This topic has 4 replies, 2 voices, and was last updated 5 years, 6 months ago by
Steve.
-
AuthorPosts
-
-
July 12, 2016 at 10:13 pm #6944
upsideMemberHey Guys,
Huge fan of Piklist and really excited about all of the recent improvements, especially add-more related. I’m trying to add an editor field to a page template and want to be able to use shortcodes in the editor field. I currently have the following code for the editor field:
piklist('field', array( 'type' => 'editor', 'field' => 'tc_education_editor', // This is the field name of the WordPress default editor 'label' => 'Program Boxes', 'scope' => 'page', 'template' => 'field', // Only display the field not the label 'options' => array( // Pass any option that is accepted by wp_editor() 'wpautop' => true, 'media_buttons' => true, 'shortcode_buttons' => true, 'teeny' => false, 'dfw' => false, 'quicktags' => true, 'drag_drop_upload' => true, 'tinymce' => array( 'resize' => false, 'wp_autoresize_on' => true ) ) ));When I try to add a Piklist shortcode (using the shortcode button) the shortcode winds up saving to the standard page editor field and not the Piklist field. Any help you can give on this is greatly appreciated. Thanks!
Also I originally had it set-up with the scope to Post and then changed to page to see if that would work. I’m pretty sure that it should always be post (unless its a CPT) but figured I’d try to cover all the bases.
-
July 15, 2016 at 9:16 am #6952
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.
-
July 15, 2016 at 12:41 pm #6956
upsideMember@steve thanks for the clarification. Unfortunately even when I change to scope => ‘post_meta” or leave blank the shortcode is still saving to the wrong editor field. On that page I have two editor fields the default (the_content) field and then the Piklist field as seen in the code above (tc_education_editor). When I try to save a piklist shortcode using the shortcode button it winds up saving into the_content field.
Is there something that I’m missing that I’ve set up wrong in the editor field code? Thanks as always for your help, you guys are awesome as is Piklist!
-
July 19, 2016 at 9:43 am #6972
SteveKeymaster@upside– can you email your plugin to [email protected] Happy to take a look.
-
July 22, 2016 at 10:44 pm #6997
SteveKeymasterThis reply has been marked as private.
-
-
AuthorPosts
- You must be logged in to reply to this topic.