false, 'teeny' => true, ); /** * Filter the settings passed to wp_editor() for the post excerpt. * * @see wp_editor() * * @param array $settings Settings for wp_editor(). */ $settings = apply_filters( 'ape_editor_settings', $settings ); wp_editor( html_entity_decode( $post->post_excerpt ), 'excerpt', $settings ); } /** * Remove the alignment buttons from the post excerpt WYSIWYG. * * @param array $buttons An array of teenyMCE buttons. * @param string $editor_id A unique identifier for the TinyMCE instance. * @return array The $buttons array, minus alignment actions. */ function ape_remove_alignment_buttons_from_excerpt( $buttons, $editor_id ) { if ( 'excerpt' === $editor_id ) { $buttons = array_values( array_diff( $buttons, array( 'alignleft', 'alignright', 'aligncenter', ) ) ); } return $buttons; } add_filter( 'teeny_mce_buttons', 'ape_remove_alignment_buttons_from_excerpt', 10, 2 );