一种方法是调整TinyMCEsettings:
add_filter( \'tiny_mce_before_init\', function( $settings ) {
$settings[\'height\'] = \'120\';
$settings[\'autoresize_max_height\'] = \'120\';
return $settings;
} );
例如,进一步限制帖子类型和!块编辑器
get_current_screen().
示例:
add_filter( \'tiny_mce_before_init\', function( $settings ) {
$screen = get_current_screen();
if ( $screen->is_block_editor() ) {
return $settings;
}
if ( ! in_array( $screen->post_type, [\'tools\', \'brand\', \'company\'], true ) ) {
return $settings;
}
$settings[\'height\'] = \'120\';
$settings[\'autoresize_max_height\'] = \'120\';
return $settings;
} );