Closed vladkucherov closed 9 years ago
Maybe
'teeny' => false,
not
'tiny' => false,
It should be already false
by default though.
in wp-includes/class-wp-editor.php
_Line:_ 318 it's teeny
so your code key is correct but still doesn't explain why I get the teeny
one :disappointed:
How do you set the rich
argument?
It should look like
'rich' => array(
'teeny' => false,
),
You may post a very simple example plugin that only demonstrates the problem so that others can reproduce the problem, something like this one.
the default is teeny => false
, and it looks like you don't change it.
of course I don't change it - so it leaves us with an issue not with the settings
I came up with this idea... The post edit page already loads the WYSIWYG editor, but then SiteOrigin Panels (after it loads) hides the editor. After, when you try to open the widget that has WYSIWYG it won't show it as rich editor because the rich one is already has been loaded.
The idea is based on what i saw in wp_editor
any ideas?
Did you have a chance to take a look at this?
Like you requested I created a gist of a widget using the editor https://gist.github.com/vladkucherov/9c881d14b8b2d75da9de
I could reproduce the problem in my environment.
To see what is going on, I changed the constructor of your code to check the passed TinyMCE settings.
public function __construct() {
parent::__construct('Text Section', array(
'classname' => 'widget_text_section',
'description' => 'Some description'
));
add_filter( 'tiny_mce_before_init', array( $this, 'replyToLogTinyMCESettings' ) );
}
public function replyToLogTinyMCESettings( $aTinyMCESettings ) {
AdminPageFramework_Debug::log( $aTinyMCESettings );
return $aTinyMCESettings;
}
The log indicates that the textarea id is modified by the SiteOrigin plugin. You'll see something like this.
[selector] => #widget-text_section_widget-{$id}-tf_content__0
The part {$id}
is where being modified. This means the set options in the rich
field argument of APF will not be set because they change the textarea ID after the TinyMCE settings for the field are passed and apply their original ID afterwards.
Still, it should be possible to apply the default TinyMCE settings to an APF generated textarea field. You may try to find a hook which gets triggered when they apply an ID to the widget, the code that converts an ID like widget-text_section_widget-{$id}-tf_content__0
to widget-text_section_widget-c14-tf_content__0
Let me know if you find one.
Closing the topic due to inactivity.
Good day,
I was wondering, how I can use more advanced editor?
I would prefer it to be:
I couldn't find an option to set it "tiny". I did find this in your code:
AdminPageFramework_FileType_textarea.php
_Line:_ 517I did find that you set
tiny => false
but I still get the tiny one.Any ideas?