Attempt to read property “ID” on null in lcp-parameters.php at line 257
-
Hello –
I have been observing this issue “Attempt to read property “ID” on null” so frequently that my log file was growing quite rapidly. Hence, I had to fix it myself.
The issue is in this function of this file: lcp-parameters.php
// Before fix, problemtic code private function lcp_get_current_post_id(){ global $post; return $post->ID; }
Once I fixed this issue, the code is:
private function lcp_get_current_post_id(){ global $post; if( ! $post instanceof WP_Post ) { return; } return $post->ID; }
Please see if you can address this in a better way possible. But the above change resolved my issue that I can confirm.
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Attempt to read property “ID” on null in lcp-parameters.php at line 257’ is closed to new replies.