wp-shortcake / shortcake

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

Way to disable Shortcake "edit existing" UI for specific shortcodes once inserted into TinyMCE #414

Closed cliffordp closed 9 years ago

cliffordp commented 9 years ago

Say I'm using shortcodes to render columns/grid... For example:

[row gap="closed"]
[col w=4]four wide here[/col]
[col w=8]eight wide[/col]
[/row]

I want to use Shortcake to do the initial insertion (gap, w, and whatever other attributes), but I want the row shortcode to be a "dumb" shortcode (not editable via Shortcake UI once inserted). Because if it had Shortcake's "edit existing" UI pop up, nothing it surrounds (the col shortcodes) would be individually selectable. And that's exactly what I want... I want the col shortcodes to be editable via Shortcake's "edit existing" UI.

I hope that makes sense.

I tried returning '' or an HTML comment when is_admin() but neither worked as desired.

Possibly related:

danielbachhuber commented 9 years ago

While nested shortcodes are a valid use of shortcodes, we don't support editing them.

cliffordp commented 9 years ago

Well I registered [row] without the Shortcake UI and I registered [col] with it... so that gets me what I wanted regarding nested shortcodes... BUT this question is about more than that. This question is separate from the issue of nested shortcodes. It is simply "is there a way to disable the Edit Existing functionality?"

bobbingwide commented 9 years ago

I have a similar problem which I reported in http://www.oik-plugins.com/2015/09/testing-shortcake-compatibility/ as "This leads to unwanted nested shortcode expansion if the containing shortcode is disabled" e.g. [bw_geshi]