PHP 8.1 causing errors
-
Using PHP 8.1, we get these PHP errors:
PHP Warning: Attempt to read property "ID" on null in */wp-content/plugins/pagerestrict/pagerestrict.php on line 155
*/wp-content/plugins/pagerestrict/pagerestrict.php on line 163We are using latest version of the plugin.
Both are fixed by changing line 152 of the pagerestrict.php file from
if ( !\is_user_logged_in() && $pr_check ) :
to
if ( !\is_user_logged_in() && $pr_check && !is_null($post) ) :
I hope this fix gets rolled out soon since PHP 7 is nearing its end of life and a lot of people will be changing to PHP8 soon. (January 1st, 2023)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP 8.1 causing errors’ is closed to new replies.