redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Custom tinymce button in wpeditor field

Open alvisir opened this issue 12 years ago • 18 comments

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.

alvisir avatar Feb 11 '14 21:02 alvisir

You'll need to enqueue your CSS and JS to add the button.

dovy avatar Feb 11 '14 21:02 dovy

I remember that in a previous version my button appeared. In default editor it works.

alvisir avatar Feb 11 '14 21:02 alvisir

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.

dovy avatar Feb 11 '14 22:02 dovy

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 avatar Feb 11 '14 22:02 alvisir

@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.

dovy avatar Feb 11 '14 23:02 dovy

Perfect, I didn't know it was so simple! Thanks a lot @dovy ! ;)

alvisir avatar Feb 11 '14 23:02 alvisir

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.

dovy avatar Feb 11 '14 23:02 dovy

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?

alvisir avatar Feb 16 '14 08:02 alvisir

@dovy Can I send you an email?

alvisir avatar Feb 22 '14 10:02 alvisir

Skype is easier: dovydigital. If you need a lot of help, supporting the project in some way would be appreciated. ;)

dovy avatar Feb 22 '14 14:02 dovy

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

ehtasham89 avatar Jun 04 '15 22:06 ehtasham89

@dovy @alvisir @alijange was this every fixed? I also updated from an earlier version of Redux and experience the custom tinymce button gone.

emorling avatar Oct 17 '15 13:10 emorling

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

emorling avatar Oct 17 '15 13:10 emorling

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.

emorling avatar Oct 17 '15 15:10 emorling

Re-open or new issue?

emorling avatar Oct 17 '15 16:10 emorling

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.

kprovance avatar Oct 17 '15 16:10 kprovance

@emorling continue with your custom code 'args' => array('teeny' => true). I had pull request already for this change but unfortunately ignored by author.

ehtasham89 avatar Oct 18 '15 01:10 ehtasham89

Okay thanks @alijange

emorling avatar Oct 18 '15 10:10 emorling