Tagged: editor field
- This topic has 1 reply, 2 voices, and was last updated 6 years, 9 months ago by
Steve.
-
AuthorPosts
-
-
April 20, 2015 at 1:17 am #3643
liquidwsMemberHello.. am I doing something wrong with the code below? The text field saves the data no problem, but the Editor Field will not save the data. Please help. Thank you in advance.
<?php /* Title: Careers Description: Description of Meta-Boxes for Careers Post Type: careers Priority: high Locked: true Order: 1 */ piklist('field', array( 'type' => 'text' ,'field' => 'careers_accepting' ,'label' => 'Accepting Applications Yes/No' ,'columns' => 10 ,'attributes' => array( 'placeholder' => 'Accepting Applications / Not Accepting Applications At This Time' ) )); piklist('field', array( 'type' => 'editor' ,'scope' => 'post' ,'field' => 'careers_description' ,'label' => __('Career Description') ,'description' => __('Enter the desciption of the Career.') // ,'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' ,'options' => array ( 'wpautop' => true ,'media_buttons' => false ,'tabindex' => '' ,'editor_css' => '' ,'editor_class' => '' ,'teeny' => false ,'dfw' => false ,'tinymce' => true ,'quicktags' => true ) )); -
April 20, 2015 at 9:35 am #3644
SteveKeymaster@liquidws– In most cases the “scope” of the field is the database table you are saving it to. You are setting the scope to “post”, which is the WordPress posts table… wp_posts. Which is fine, if you use any of the fields WordPress allows. Which in your case would probably be post_content or post_excerpt. But you are saving it to a custom field, careers_description, which is not allowed in wp_posts… but is allowed in wp_postmeta.
Just remove the
scopeparameter and Piklist will figure it out and save it properly.You can see the full WordPress database schema here >
-
-
AuthorPosts
- You must be logged in to reply to this topic.