Shortcodes in title
-
Hi, Ajay!
Contextual Related Posts 3.0.7
I use shortcodes in posts titles (<h1>). For adding support to this feature for your great plugin I use:
add_filter ('crp_title', function ($title) { return do_shortcode ($title); });
This works, but not good. If title is long enough, plugin crop it and make shortcode unworkable. As I can see in your code, you add filter after title cropping:
function crp_title( $args, $result ) { $title = crp_trim_char( $result->post_title, $args['title_length'] ); // Get the post title and crop it if needed. ... return apply_filters( 'crp_title', $title, $result, $args ); }
Can I do something to execute shortcodes correctly without editing code of your plugin?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Shortcodes in title’ is closed to new replies.