Viewing 4 replies - 1 through 4 (of 4 total)
  • Anonymous User 10765487

    (@anonymized-10765487)

    There’s already a wp_strip_all_tags() in wp_trim_words(), no use to add your strip tags

    Thread Starter stephen_connolly

    (@stephen_connolly)

    Ok, thanks,

    I’ve just tried adding a filter (in my theme’s funtions.php) as follows:

    add_filter('jm_tc_get_excerpt', 'wp_strip_all_tags($content)');

    and I tried:

    add_filter('jm_tc_get_excerpt', 'wp_strip_all_tags()');

    but filter is not being called.

    Any thought ?

    Anonymous User 10765487

    (@anonymized-10765487)

    It’s already implemented in plugin because I use wp_trim_words() for the excerpt.

    Filters do not work that way in WP. You’d better do something like this:

    add_filter('jm_tc_get_excerpt', '_strip_my_tags');
    function _strip_my_tags( $content ) {
      return wp_strip_all_tags($content);
    }

    But as I said it’s already in the plugin (with the latest version)

    Thread Starter stephen_connolly

    (@stephen_connolly)

    Form some reason the function _strip_my_tags is not being executed, from my functions.php script in my theme’s folder.

    Anyway, I got around the problem by making the following change in jm-twitter-card.php:

    $output .= '<meta name="twitter:description" content="' . jm_tc_remove_lb( wp_strip_all_tags($cardDescription) ) . '"/>' . "\n";

    Not ideal but works.

    Thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with Description’ is closed to new replies.