Custom tinymce button in wpeditor field
Hi, I've created my own shortcodes plugin that it adds a tinymce button with which it shows a modal box. I notice that this button doesn't appear in the wpeditor field...Is it normal? It's extremely important that I can put my shortcodes in this field.
You'll need to enqueue your CSS and JS to add the button.
I remember that in a previous version my button appeared. In default editor it works.
I've never seen it work like that. We just call a JS function is all. I am sure we can figure it out. Care to dig in a little and try and find a solution? You have a pretty specific need.
ok, if I set to false the 'teeny' array key in 'ReduxFramework/ReduxCore/inc/fields/editor/field_editor.php' (row 71), my button appears. The problem is that I must edit a core file...
@alvisir this isn't a bug but a feature. I just updated the editor field to make the key more standard, but here's what you do. In your field declaration, do:
'args' => array( 'teeny' => false )
That's it. ;) You'll have all you need.
Perfect, I didn't know it was so simple! Thanks a lot @dovy ! ;)
You're quite welcome. If you like Redux please leave a review (if you haven't already).
http://wordpress.org/support/view/plugin-reviews/redux-framework
Thanks.
I'm very sorry @dovy . I had forgotten that I had changed the wpeditor field core file, setting to true the teeny parameter....After upgrading the plugin, I realized the thing. I added the args index to the field array but doesn't work :(
array(
'id' => 'id_editor',
'type' => 'editor',
'title' => __('Some Text', 'redux'),
'subtitle' => __('Some text', 'redux'),
'default' => '',
'args' => array( 'teeny' => false )
),
Where am I doing wrong?
@dovy Can I send you an email?
Skype is easier: dovydigital. If you need a lot of help, supporting the project in some way would be appreciated. ;)
Hi @dovy : 'args' => array('teeny' => false) is not working for me. It is not showing my shortcode button but if i reverse it like 'args' => array('teeny' => true) and also update core editor field code on line number 73 to 'teeny' => false, then its working fine. what's wrong with it ? thanks
@dovy @alvisir @alijange was this every fixed? I also updated from an earlier version of Redux and experience the custom tinymce button gone.
It seems that the 2 filters : mce_external_plugins mce_buttons
are never being called and therefore the tinymce never being loaded. Works exactly like expected for posts and pages, so it's something to do with how tiny is loaded in Redux
There appears to be a bug in the field_editor.php function render() The args passed are empty. So the teeny=>false never makes it there.
Re-open or new issue?
This is (or was) supposed to be a community project. My suggestion would be to dig into the code for yourself, then offer a pull request so the community might benefit. If you plan on just waiting for one of us to donate yet more free time, the wait will amount to weeks, or months.
@emorling continue with your custom code 'args' => array('teeny' => true). I had pull request already for this change but unfortunately ignored by author.
Okay thanks @alijange