admin管理员组文章数量:1394171
time. Last week I updated to version 7.0 of php and from there it is giving me the following errors:
Notice: Trying to get property 'ID' of non-object in web_URL/wp-content/themes/stellenportal/tool-box.php on line 33
Notice: Trying to get property 'post_author' of non-object in web_URL/wp-content/themes/stellenportal/tool-box.php on line 34
Here's my code:
at the beginning of the PHP file:
$job_id = isset( $_GET['job_id'] ) ? $_GET['job_id'] : false;
Line 32, Line 33:
$job = get_post($job_id);
$job_id = $job->ID;
Line 34
if ( is_user_logged_in() && $current_user->ID === intval( $job->post_author ) || current_user_can( 'administrator' ) || is_admin() ) :
I have read that this is due to a change in php 7.2, but I do not give the correct form. Can somebody help me? Thank you
本文标签: phpTrying to get property 39ID39 and 39postauthor39 of nonobject error
版权声明:本文标题:php - Trying to get property 'ID' and 'post_author' of non-object error 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744737075a2622395.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论