WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Problem with Description

[Resolved] Problem with Description

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author tweetpressfr

    @jmlapam

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

    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 ?

    Plugin Author tweetpressfr

    @jmlapam

    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)

    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 ‘[Resolved] Problem with Description’ is closed to new replies.