Closed montchr closed 8 years ago
Rather than refactoring everything, what if we had a filter on do_shortcode_callback()
which let you manipulate the return value however you liked?
https://github.com/wp-shortcake/shortcake-bakery/blob/master/inc/class-shortcake-bakery.php#L94-L107
Yes that does sound a lot simpler. :+1:
I do still think standardizing classes would be good, but that's probably better off as a new issue. Having a filter for output would negate an immediate need for changing other classes around too.
Would that be something like changing https://github.com/wp-shortcake/shortcake-bakery/blob/master/inc/class-shortcake-bakery.php#L106 from:
return $class::callback( $attrs, $content, $shortcode_tag );
to:
$output = $class::callback( $attrs, $content, $shortcode_tag );
return apply_filters( 'shortcake_bakery_output_callback', $output, $attrs, $content, $shortcode_tag );
Yep, although I'd do:
return apply_filters( 'shortcake_bakery_shortcode_callback', $output, $shortcode_tag, $attrs, $content );
Cool. I'll get on this tomorrow morning. Having some trouble actually loading the plugin as it doesn't want to work as a submodule within our theme (though it does work as a normal plugin)…
I'm working on some new functionality on my site for which this plugin will be a huge help. But I need to be able to edit the classes of the output HTML.
For example, in class-instagram.php L70:
I'd like to be able to add additional classes, maybe something like:
I also think there should be some standardized classes across all of these shortcodes. The Soundcloud
<iframe>
, for example, has no classes at all, which makes targeting with CSS near impossible.I'd be willing to open a PR for this if desired.