I don’t know how but my theme is showing me this error:
Warning: Creating default object from empty value in /custom_functions.php on line 792
I found the code in custom_functions.php on line 792 as
$update_transient->response = array_merge(!empty($update_transient->response) ? $update_transient->response : array(), $et_update_themes->response);
What I need to do, to solve it??
So first explaining how this line works. The question mark is a ternary operator and makes the statement work like this:
(The arrows refer to pulling the values from associative arrays or object instances)
Either way the if statement flows,
$update_transient->response
is being set to something.I would wager that your error is because
$update_transient->response
is null. You may be seeing this error for the first time because of an upgrade to your PHP version.You should try adding an if statement before to check if the value is empty. If it is, then set it to
stdClass
.(stdClass is PHP’s generic empty class)