<?php function filter_wp_editor_settings( $settings, $editor_id ) { global $post; // Target if ( $editor_id == 'excerpt' && get_post_type( $post ) == 'product' ) { // Settings $settings = array( // Disable autop if the current post has blocks in it. 'wpautop' => ! has_blocks(), 'media_buttons' => false, 'default_editor' => '', 'drag_drop_upload' => false, 'textarea_name' => $editor_id, 'textarea_rows' => 20, 'tabindex' => '', 'tabfocus_elements' => ':prev,:next', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, '_content_editor_dfw' => false, 'tinymce' => false, 'quicktags' => false, ); } return $settings; } add_filter( 'wp_editor_settings', 'filter_wp_editor_settings', 1, 2 );
0개의 댓글