Open swinggraphics opened 4 years ago
+1
For anyone who finds this looking for a solution, this is what I'm currently using for a specific case:
/* Superscript TM and R */
function my_sup_tm_r( $content ) {
$content = preg_replace( '%(™|™|™|™)(?!</sup>)%', '<sup>$1</sup>', $content );
$content = preg_replace( '%(®|®|®|®)(?!</sup>)%', '<sup>$1</sup>', $content );
return $content;
}
add_filter( 'the_content', 'my_sup_tm_r', 20 );
add_filter( 'do_shortcode_tag', 'my_sup_tm_r', 20 );
+1
+1 need something like this to do URL modification to support an image CDN. It would also be good to be able to filter the oxy generated CSS for these URLs as well.
Many membership plugins that restrict access to pages appear to use "the_content" filter. Is there an easy way to add this filter to the "Inner Content" element in templates so that this can work with Oxygen Builder?
Many membership plugins that restrict access to pages appear to use "the_content" filter. Is there an easy way to add this filter to the "Inner Content" element in templates so that this can work with Oxygen Builder?
The inner content module uses the_content()
, so the filters should be applied. For example, this works:
function filter_test( $content ) {
return $content . '<!-- FILTER TEST -->';
}
add_filter( 'the_content', 'filter_test' );
Where do I add this code? In a oxygen code block at "Inner Content"? I can't get it working.
Describe the feature you'd like to see included in Oxygen. Because Oxygen doesn't run
the_content
filters on pages built in it, it would be helpful if Oxygen would (really, should) run a similar filter after doing its shortcodes. While we can filterdo_shortcode_tag
, that will get run many times on a page, and that can lead to very complex coding or filters being run too many times.In addition to a filter in the code, it might be neat to be able to tell parts of a template to run specific filters on its output. For example, I would want to set an Inner Content to apply
the_content
filters.What are the use cases for this feature? Our own filters for special characters, language needs, easier integration with plugins, etc.