wp-shortcake / shortcake

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

Plugin attributes vs Layout (Theme) Attributes #603

Open raptor235 opened 8 years ago

raptor235 commented 8 years ago

It would be great to be able to add general attributes to existing shortcodes...

As an example let's say plugin X has shortcake integration... but it would take additional attributes from the theme... let's say the theme is running bootstrap...

You might want to add layout attributes to shortcode attributes and wrap the original plugin shortcode... this way you can introduce layout that's driven by the theme and have the core business logic of the plugin drive it's specific non layout workings...

Thoughts?

goldenapples commented 8 years ago

I'm not clear on the question. Are you talking about making it easier to add additional fields to shortcode UI, or making it easier to filter the output of shortcodes?

Adding fields to shortcode UI for shortcodes which have already been registered can be done on the shortcode_ui_shortcodes, though its a little hairy.

Making the layout of a shortcode's output filterable would have to be done inside the shortcode callback itself, unless I'm missing what you're asking.

raptor235 commented 8 years ago

Sorry here is some more clarification...

Basically we currently have the ability to build fields for shortcodes which specifically are configured for the shortcode inner workings.

I think it would be great to think about giving the ability for theme authors to add global fields that apply to all shortcodes.

That way no matter which shortcode you decide to work with the theme itself can add fields that are specific to how a shortcode interacts with the theme... I'm thinking mostly layout configuration here...

I follow that we can register or own but registering our own field for all shortcodes is what I'm after.