I'm setting og:description programmatically like this:
$description = apply_filters( 'the_content', get_the_content() );
This works fine.
However, the $description contains some superfluous content which I'm trying to remove. When I do this it never seems to work. This is what I'm trying:
$pos = strpos( $description, $superfluous_content ) + strlen( $superfluous_content );
$description = substr( $description, $pos );
I've tried removing html tags and all kinds of different approaches, but it never makes a difference. I'm guessing $description contains some kind of hidden characters as $pos always returns 0.
Can anyone suggest what's happening here and how I can manipulate $description as a simple text string?
Thanks in advance!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744696125a4588501.html
评论列表(0条)