• I am getting these PHP Warnings at the top of EVERY page …

    Warning: Trying to access array offset on value of type bool in C:\wamp64\www\wp-dev\wp-content\plugins\one-click-order-reorder\includes\class-basket-order.php on line 111
    
    Warning: Trying to access array offset on value of type bool in C:\wamp64\www\wp-dev\wp-content\plugins\one-click-order-reorder\includes\class-basket-order.php on line 118
    
    Warning: Trying to access array offset on value of type bool in C:\wamp64\www\wp-dev\wp-content\plugins\one-click-order-reorder\includes\class-basket-order.php on line 122

    Please fix or I can’t continue to use the plugin. Also I don’t think the plugin code should be run on every page, only the pages where it’s needed.

Viewing 1 replies (of 1 total)
  • Thread Starter sgeithman1ecos

    (@sgeithman1ecos)

    Those warnings are gone once you save the settings with values.

    It happens because get_option() returns false if it is not set and the code is looking for an array if(is_array($settings[....

    To fix those warnings, you should set some default values or use if($settings !== false && is_array($settings[...

Viewing 1 replies (of 1 total)
  • The topic ‘Warning: Trying to access array offset on value of type bool’ is closed to new replies.