wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 142 forks source link

Add Post Element button showing up in bbPress #677

Closed guillaumemolter closed 7 years ago

guillaumemolter commented 7 years ago

The new "Add Post Element" button is also showing up in instances of the tiny/compact WYSIWYG editor in bbPress (and most likely in comments, etc..). The button doesn't work but is here. I should also add that I am displaying the Media Library on purpose.

I've desperately tried to remove it using remove_action( 'media_buttons', array( 'Shortcode_UI', 'action_media_buttons' )); using different hooks and priorities but without success.

1) I don't think the button should show by default 2) Any suggestions on how to remove it ?

screen shot 2016-12-19 at 15 59 53

goldenapples commented 7 years ago

Hi @guillaumemolter -

It looks like the remove_action call you have there is just a little bit off. Since the method that adds the media button is an instance method rather than a static method, you'd have to remove it like this:

remove_action( 'media_buttons', array( Shortcode_UI::get_instance(), 'action_media_buttons' ));

That function also takes the DOM element ID of the editor as an argument, so you should be able to remove that method and add your own callback which outputs the "Add post element" media button for only the editors that you want to actually support it for.