Tagged: editor field, post_content, post_excerpt
- This topic has 2 replies, 3 voices, and was last updated 4 years, 6 months ago by
matrosero.
Viewing 2 reply threads
-
AuthorPosts
-
-
March 8, 2017 at 4:19 am #7827
norbooMemberI’m trying to replace “post_excerpt” and “post_content” with Piklist editor fields and everything seems to work fine with one exception: I can’t completly delete the content of either of these fields, I must have at least an empty space ” ” for the fields to save.
<?php /* Title: Content Post Type: page, post, tour (a CPT) */ piklist('field', array( 'type' => 'editor' ,'scope' => 'post' ,'field' => 'post_content' ,'label' => 'Content' ,'template' => 'field' ,'description' => 'This is a custom Content' ,'value' => ' ' ,'options' => array( 'wpautop' => true ,'media_buttons' => true ,'shortcode_buttons' => true ,'teeny' => false ,'dfw' => false ,'tinymce' => array( 'resize' => false ,'wp_autoresize_on' => true ) ,'quicktags' => true ,'drag_drop_upload' => true ) ,'on_post_status' => array( 'value' => 'lock' ) )); <?php /* Title: Excerpt Post Type: post, page, tour (CPT) */ piklist('field', array( 'type' => 'editor' ,'scope' => 'post' ,'field' => 'post_excerpt' ,'label' => 'Excerpt' ,'template' => 'field' ,'description' => 'This is a custom Excerpt' ,'options' => array( 'wpautop' => true ,'media_buttons' => true ,'shortcode_buttons' => true ,'teeny' => false ,'dfw' => false ,'tinymce' => array( 'resize' => false ,'wp_autoresize_on' => true ) ,'quicktags' => true ,'drag_drop_upload' => true ) ,'on_post_status' => array( 'value' => 'lock' ) )); //functions.php function my_remove_post_type_support() { remove_post_type_support('post', 'excerpt'); remove_post_type_support('post', 'editor'); remove_post_type_support('post', 'custom-fields'); remove_post_type_support('page', 'editor'); remove_post_type_support('page', 'excerpt'); remove_post_type_support('page', 'custom-fields'); } add_action('init', 'my_remove_post_type_support',10); -
March 15, 2017 at 10:34 pm #7842
SteveKeymasterThat’s really odd. Try deleting this from each field since you don’t need it:
,'on_post_status' => array( 'value' => 'lock' ) -
July 26, 2017 at 1:11 am #8334
matroseroParticipantHi, I’m having the same issue. Here’s my code:
piklist(‘field’, array(
‘type’ => ‘editor’,
‘scope’ => ‘post’,
‘template’ => ‘field’,
‘field’ => ‘post_excerpt’,
‘options’ => array (
‘media_buttons’ => false,
‘teeny’ => false,
),
));
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.