mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Improve handling of init and adding buttons to Quicktags, fixes #19098
git-svn-id: https://develop.svn.wordpress.org/trunk@19172 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -139,35 +139,25 @@ class WP_Editor {
|
||||
$first_run = false;
|
||||
|
||||
if ( $this->this_quicktags ) {
|
||||
$qt_buttons = array();
|
||||
|
||||
$qtInit = array(
|
||||
'id' => $editor_id,
|
||||
'buttons' => '',
|
||||
'disabled_buttons' => ''
|
||||
'buttons' => ''
|
||||
);
|
||||
|
||||
if ( is_array($set['quicktags']) )
|
||||
$qtInit = array_merge($qtInit, $set['quicktags']);
|
||||
|
||||
$qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
|
||||
|
||||
$this->qt_settings[$editor_id] = $qtInit;
|
||||
|
||||
if ( !empty($qtInit['buttons']) || !empty($qtInit['disabled_buttons']) ) {
|
||||
if ( strpos( ',' . $qtInit['buttons'] . ',', ',link,' ) !== false )
|
||||
$qt_buttons[] = 'link';
|
||||
|
||||
if ( strpos( ',' . $qtInit['disabled_buttons'] . ',', ',link,' ) !== false )
|
||||
$qt_buttons = array();
|
||||
} else {
|
||||
$qt_buttons[] = 'link';
|
||||
}
|
||||
if ( empty($qtInit['buttons']) )
|
||||
$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';
|
||||
|
||||
if ( $set['dfw'] )
|
||||
$qt_buttons[] = 'fullscreen';
|
||||
$qtInit['buttons'] .= ',fullscreen';
|
||||
|
||||
$this->qt_buttons = array_merge( $this->qt_buttons, $qt_buttons );
|
||||
$qtInit = apply_filters('quicktags_settings', $qtInit, $editor_id);
|
||||
$this->qt_settings[$editor_id] = $qtInit;
|
||||
|
||||
$this->qt_buttons = array_merge( $this->qt_buttons, explode(',', $qtInit['buttons']) );
|
||||
}
|
||||
|
||||
if ( $this->this_tinymce ) {
|
||||
|
||||
Reference in New Issue
Block a user