Error when $post object does not exist
-
Your plugin runs the load_scripts function with the wp_enqueue_scripts hook. This means that function is called on every page load. But not every page load has a $post object. This results in an error thrown when $post does not exist.
Please add at line 134:
if( !$post ) return;
- The topic ‘Error when $post object does not exist’ is closed to new replies.