web-dev-qa-db-ja.com

wp-includes/comment-template.php:26 - 非オブジェクトのプロパティを取得しようとしています

私の新しいサイトをデバッグするとき、私はこの通知を受け取ります。

誰がこれが何を意味するのか知っていますか?サイトを壊すことはありませんが、デバッグモードをオンにしてこの問題を解決したい場合には、単なる警告です。

この通知は、コメントオプションが利用可能な場合にのみ表示されます。あなたが単一の投稿ページで、コメントがダッシュボードを通して閉じられたとき、この通知は現れません。

これは私が得る「エラー」です:

注意:wp-includes/comment-template.php:26 - 非オブジェクトのプロパティを取得しようとしています

require( 'wp-blog-header.php')、require_once( 'wp-includes/template-loader.php')、include( '/ themes/XXX/my-templates/template-home.php')、get_footer、 locate_template、load_template、するrequire_once( '/テーマ/ XXX/footer.php')、wp_footer、do_action( 'wp_footer')、call_user_func_array、wp_admin_bar_render、do_action_ref_array、call_user_func_array、wp_admin_bar_my_account_item、get_avatar、apply_filters( 'get_avatar')、call_user_func_array、XXX_remove_dimensions_avatars、 get_comment_author

1
Jack Ottermans

コメントごとに、have_comments()などのコメントテンプレート関数を使用する前に、まずget_comment_author()を確認する必要があります。それ以外の場合は、nullコメントオブジェクトに対してメソッドを呼び出そうとし、PHP warningsを生成します。

1
bonger