{"id":16555902,"date":"2023-03-13T20:22:31","date_gmt":"2023-03-13T20:22:31","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/array-offset-null\/"},"modified":"2023-03-13T20:22:31","modified_gmt":"2023-03-13T20:22:31","slug":"array-offset-null","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/array-offset-null\/","title":{"rendered":"Array offset null"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">It appears with the recent update to WordPress core 6.1 (running PHP8.1) there seems to be a few error\/warning notifications around validating for null offsets. I&#8217;ve identified these issues down to 3 specific files, and the same if statement within them, I would suggest adding a null validation prior to the check to resolve the issues. Here are the files and the lines I would add the validations before.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>limit_offset.php &#8211; line 4<\/strong>4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Suggest adding initial variable validation\nif ( $wp_nav_plus_limit_offset_options === null ){\n\treturn $items;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>menu_segment.php &#8211; line 43<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Suggest adding initial variable validation\nif ( $wp_nav_plus_menu_segment_options === null ){\n\treturn $items;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>start_depth.php &#8211; line 54<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Suggest adding initial variable validation\nif ( $wp_nav_plus_start_depth_options === null ){\n\treturn $items;\n}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-16555902","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16555902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16555902\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16555902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}