admin管理员组文章数量:1391969
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!
本文标签: filtershow to use substr with getthecontent()
版权声明:本文标题:filters - how to use substr with get_the_content() 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744696124a2620287.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论