【发布时间】:2018-08-18 01:19:35
【问题描述】:
我正在使用 get_term_link 检索术语链接并在 href(链接)中回显它。
它可以在网站上运行,但是当我抓取网站时,它throws the status code 500。
当它出现在服务器上的 php_errors.log 中时,我发现了这一点。
错误:PHP 可捕获的致命错误:WP_Error 类的对象无法 在..etc/etc/中转换为字符串
$get_term = get_term_by('slug', 'term', 'taxonomy');
$link = get_term_link($get_term->term_id, 'taxonomy');
如何避免这个抓取问题?非常感谢您的反馈,谢谢
【问题讨论】:
-
将所有代码放入您的问题中。我们无法猜测为什么会出现错误
标签: php wordpress fatal-error taxonomy