Closed QWp6t closed 3 months ago
Resolves the following PHP warning message:
Warning: Creating default object from empty value
This warning was caused because $post had not been set, i.e., it was null.
$post
If we don't like get_post($post_id), then the following workaround would also get rid of the warning:
get_post($post_id)
$post = is_object($post)?$post:new stdClass(); $post->ID = $post_id;
You would insert that near L199.
Resolves the following PHP warning message:
This warning was caused because
$post
had not been set, i.e., it was null.If we don't like
get_post($post_id)
, then the following workaround would also get rid of the warning:You would insert that near L199.