{"id":18833858,"date":"2026-02-25T18:26:42","date_gmt":"2026-02-25T18:26:42","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/admin-menu-editor-array-warnings\/"},"modified":"2026-02-25T18:26:42","modified_gmt":"2026-02-25T18:26:42","slug":"admin-menu-editor-array-warnings","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/admin-menu-editor-array-warnings\/","title":{"rendered":"admin menu editor array warnings"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Problem:<\/strong> <\/p>\n\n\n\n<ul>\n<li>When viewing Ultimate Dashboard =&gt; Admin Menu Editor tab, the following PHP warnings from <em>a different<\/em> plugin, &#8220;Posts 2 Posts&#8221;, appear in the debug logs:<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">[25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key &#8220;toplevel&#8221; in \/sites\/WEBSITE\/files\/wp-content\/plugins\/posts-to-posts\/vendor\/scribu\/scb-framework\/AdminPage.php on line 454<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key &#8220;menu_title&#8221; in \/sites\/WEBSITE\/files\/wp-content\/plugins\/posts-to-posts\/vendor\/scribu\/scb-framework\/AdminPage.php on line 458<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key &#8220;capability&#8221; in \/sites\/WEBSITE\/files\/wp-content\/plugins\/posts-to-posts\/vendor\/scribu\/scb-framework\/AdminPage.php on line 459<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>       \/**<br \/>448\t         * Registers a page.<br \/>449\t         *<br \/>450\t         * @return void<br \/>451\t         *\/<br \/>452\t        public function page_init() {<br \/>453\t<br \/>454\t                if ( ! $this-&gt;args&#091;'toplevel'] ) {<br \/>455\t                        $this-&gt;pagehook = add_submenu_page(<br \/>456\t                                $this-&gt;args&#091;'parent'],<br \/>457\t                                $this-&gt;args&#091;'page_title'],<br \/>458\t                                $this-&gt;args&#091;'menu_title'],<br \/>459\t                                $this-&gt;args&#091;'capability'],<br \/>460\t                                $this-&gt;args&#091;'page_slug'],<br \/>461\t                                array( $this, '_page_content_hook' )<br \/>462\t                        );<br \/>463\t                } else {<br \/>464\t                        $func = 'add_' . $this-&gt;args&#091;'toplevel'] . '_page';<br \/>465\t                        $this-&gt;pagehook = $func(<br \/>466\t                                $this-&gt;args&#091;'page_title'],<br \/>467\t                                $this-&gt;args&#091;'menu_title'],<br \/>468\t                                $this-&gt;args&#091;'capability'],<br \/>469\t                                $this-&gt;args&#091;'page_slug'],<br \/>470\t                                null,<br \/>471\t                                $this-&gt;args&#091;'icon_url'],<br \/>472\t                                $this-&gt;args&#091;'position']<br \/>473\t                        );<br \/>474\t<br \/>475\t                        add_submenu_page(<br \/>476\t                                $this-&gt;args&#091;'page_slug'],<br \/>477\t                                $this-&gt;args&#091;'page_title'],<br \/>478\t                                $this-&gt;args&#091;'submenu_title'],<br \/>479\t                                $this-&gt;args&#091;'capability'],<br \/>480\t                                $this-&gt;args&#091;'page_slug'],<br \/>481\t                                array( $this, '_page_content_hook' )<br \/>482\t                        );<br \/>483\t                }<br \/>484\t<br \/>485\t                if ( ! $this-&gt;pagehook ) {<br \/>486\t                        return;<br \/>487\t                }<br \/>488\t<br \/>489\t                add_action( 'load-' . $this-&gt;pagehook, array( $this, 'page_loaded' ) );<br \/>490\t<br \/>491\t                add_action( 'admin_print_styles-' . $this-&gt;pagehook, array( $this, 'page_head' ) );<br \/>492\t        }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Steps to Reproduce:<\/strong><\/p>\n\n\n\n<ol>\n<li>Install Posts 2 Posts<\/li>\n\n\n\n<li>Install Ultimate Dashboard<\/li>\n\n\n\n<li>Navigate to wp-admin =&gt; ultimate dashboard =&gt; admin menu editor<\/li>\n\n\n\n<li>Observe PHP warnings in log<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Observations:<\/strong><\/p>\n\n\n\n<ol>\n<li>These warnings only occur on the one page, oddly.<\/li>\n\n\n\n<li>The page is functional (we don&#8217;t have PRO, but the page loads fine).<\/li>\n\n\n\n<li>They appear to result from the other plugins framework expecting certain array keys (toplevel, menu_title, capability) that this plugin, Ultimate Dashboard, does not provide when instantiating AdminPage objects on this tab.<\/li>\n\n\n\n<li>These warnings are non-fatal and do not affect site operation.<\/li>\n\n\n\n<li>This seems to be an integration edge case.<\/li>\n\n\n\n<li>When did this start? Not sure, unfortunately. We don&#8217;t use this tab and only found the error from testing a new update for Ultimate Dashboard.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Environment Details:<\/strong><\/p>\n\n\n\n<ol>\n<li>PHP 8.3<\/li>\n\n\n\n<li>WordPress v6.9.1<\/li>\n\n\n\n<li>Posts 2 Posts v1.7.6<\/li>\n\n\n\n<li>Ultimate Dashboard v3.8.13<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve also reported this with Posts 2 Posts. I couldn&#8217;t decide which plugin to notify, so I notified both. If you believe this is solely a Posts 2 Posts issue, please let me know and I will continue with them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you for your time.<\/p>\n","protected":false},"template":"","class_list":["post-18833858","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18833858","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\/18833858\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18833858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}