quicktags_settings
Allows you to configure the WordPress text editor — Quicktags.
Usage
add_filter( 'quicktags_settings', 'filter_function_name_11', 10, 2 );
function filter_function_name_11( $qtinit, $editor_id ) {
// Filter...
return $qtinit;
}
Parameters
- $qtinit(array)
- An array of settings. The default buttons in
$qtinit['buttons']arestrong,em,link,block,del,ins,img,ul,ol,li,code,more,close. - $editor_id(string)
- The ID of the editor for which the settings are specified. For example, 'content'.
Examples
#1 Remove all buttons except the specified ones from the text editor
add_filter('quicktags_settings', 'filter_quicktags_settings', 10, 2);
function filter_quicktags_settings( $qtinit, $editor_id ){
if( $editor_id == "content" ){
// Define the set of buttons
$qtinit['buttons'] ='strong,ul,ol,li,code';
}
return $qtinit;
}Changelog
| Since 3.3.0 | Introduced. |
Where the hook is called
quicktags_settings
wp-includes/class-wp-editor.php 361
$qt_init = apply_filters( 'quicktags_settings', $qt_init, $editor_id );