Usually this error shows at the top of your site something like this
Warning: Creating default object from empty value in ThemeName/functions/admin-hooks.php on line 316
I found 2 ways to solve this but only tested 1 of the solution and it solves the problem so I haven’t check if the 2nd solution will work.
Okay below are a sample code snippets taken from the admin-hooks.php
if ( isset( $query_context->context ) && is_array( $query_context->context ) ) { return $query_context->context; } // End IF Statement $query_context->context = array();
So what I did was to make the variable $query_context to stdClass by declaring this
$query_context = new stdClass();
You will need to add this before you declare the variable to array, so my final code will look something like this
$query_context = new stdClass(); if ( isset( $query_context->context ) && is_array( $query_context->context ) ) { return $query_context->context; } // End IF Statement $query_context->context = array();
And that solve my problem if you have questions or suggestions please leave a comment below and here is the original post.
Thank you. I always get this error.
Andy Bland recently posted..Auto-Responder.net
Thank you, thank you. Now I know how to deal with this error.
David Ryan recently posted..New web-site
awesome
This error is seriously the bane of my existence. So thanks for the tutorial.
Judy Charlotte recently posted..Ruby Weight Loss