Title: admin menu editor array warnings
Last modified: February 25, 2026

---

# admin menu editor array warnings

 *  Resolved [annaam](https://wordpress.org/support/users/annaam/)
 * (@annaam)
 * [3 months ago](https://wordpress.org/support/topic/admin-menu-editor-array-warnings/)
 * Hello,
 * **Problem:**
    - When viewing Ultimate Dashboard => Admin Menu Editor tab, the following PHP
      warnings from _a different_ plugin, “Posts 2 Posts”, appear in the debug logs:
 * > [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “toplevel” in /
   > sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/
   > AdminPage.php on line 454
   > [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “menu_title” in/
   > sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/
   > AdminPage.php on line 458
   > [25-Feb-2026 17:04:28 UTC] PHP Warning: Undefined array key “capability” in/
   > sites/WEBSITE/files/wp-content/plugins/posts-to-posts/vendor/scribu/scb-framework/
   > AdminPage.php on line 459
 *     ```wp-block-code
              /**448	         * Registers a page.449	         *450	         * @return void451	         */452	        public function page_init() {453	454	                if ( ! $this->args['toplevel'] ) {455	                        $this->pagehook = add_submenu_page(456	                                $this->args['parent'],457	                                $this->args['page_title'],458	                                $this->args['menu_title'],459	                                $this->args['capability'],460	                                $this->args['page_slug'],461	                                array( $this, '_page_content_hook' )462	                        );463	                } else {464	                        $func = 'add_' . $this->args['toplevel'] . '_page';465	                        $this->pagehook = $func(466	                                $this->args['page_title'],467	                                $this->args['menu_title'],468	                                $this->args['capability'],469	                                $this->args['page_slug'],470	                                null,471	                                $this->args['icon_url'],472	                                $this->args['position']473	                        );474	475	                        add_submenu_page(476	                                $this->args['page_slug'],477	                                $this->args['page_title'],478	                                $this->args['submenu_title'],479	                                $this->args['capability'],480	                                $this->args['page_slug'],481	                                array( $this, '_page_content_hook' )482	                        );483	                }484	485	                if ( ! $this->pagehook ) {486	                        return;487	                }488	489	                add_action( 'load-' . $this->pagehook, array( $this, 'page_loaded' ) );490	491	                add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );492	        }
       ```
   
 * **Steps to Reproduce:**
    1. Install Posts 2 Posts
    2. Install Ultimate Dashboard
    3. Navigate to wp-admin => ultimate dashboard => admin menu editor
    4. Observe PHP warnings in log
 * **Observations:**
    1. These warnings only occur on the one page, oddly.
    2. The page is functional (we don’t have PRO, but the page loads fine).
    3. 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.
    4. These warnings are non-fatal and do not affect site operation.
    5. This seems to be an integration edge case.
    6. When did this start? Not sure, unfortunately. We don’t use this tab and only
       found the error from testing a new update for Ultimate Dashboard.
 * **Environment Details:**
    1. PHP 8.3
    2. WordPress v6.9.1
    3. Posts 2 Posts v1.7.6
    4. Ultimate Dashboard v3.8.13
 * I’ve also reported this with Posts 2 Posts. I couldn’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.
 * Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [David Vongries](https://wordpress.org/support/users/davidvongries/)
 * (@davidvongries)
 * [3 months ago](https://wordpress.org/support/topic/admin-menu-editor-array-warnings/#post-18835528)
 * Hi [@annaam](https://wordpress.org/support/users/annaam/),
 * We looked into this and concluded that this is an issue with the Posts 2 Posts
   plugin.
 * The culprit is `init_args()` in [posts-to-posts/admin/tools-page.php#L17](https://plugins.trac.wordpress.org/browser/posts-to-posts/tags/1.7.6/admin/tools-page.php#L17)
   
   It uses a raw array assignment instead of merging, so it wipes out all the defaults
   that `check_args()` had populated in [posts-to-posts/vendor/scribu/scb-framework/AdminPage.php#L508](https://plugins.trac.wordpress.org/browser/posts-to-posts/tags/1.7.6/vendor/scribu/scb-framework/AdminPage.php#L508)
 * **Fix suggested for “Posts 2 Posts” plugin:**
 * The fix belongs in [P2P_Tools_Page::init_args()](https://plugins.trac.wordpress.org/browser/posts-to-posts/tags/1.7.6/admin/tools-page.php#L17)–
   it should use `wp_parse_args()` to merge onto existing args instead of replacing
   them.
 * This:
 *     ```wp-block-code
       function init_args() {	$this->args = array(		'page_title' => __( 'Connection Types', P2P_TEXTDOMAIN ),		'page_slug' => 'connection-types',		'parent' => 'tools.php'	);}
       ```
   
 * Should become this:
 *     ```wp-block-code
       function init_args() {	$this->args = wp_parse_args( array(		'page_title' => __( 'Connection Types', P2P_TEXTDOMAIN ),		'page_slug'  => 'connection-types',		'parent'     => 'tools.php',	), $this->args );}
       ```
   
 * This preserves all the defaults from `check_args()` while still allowing `init_args()`
   to update the translated `page_title`.
 * Best,
   David
 *  Thread Starter [annaam](https://wordpress.org/support/users/annaam/)
 * (@annaam)
 * [2 months, 4 weeks ago](https://wordpress.org/support/topic/admin-menu-editor-array-warnings/#post-18838539)
 * Thank you very much for your detailed reply. Posts 2 Posts was able to implement
   the fix.
 * Best,

Viewing 2 replies - 1 through 2 (of 2 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadmin-menu-editor-array-warnings%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/ultimate-dashboard/assets/icon-256x256.png?rev=2859260)
 * [Ultimate Dashboard - Custom WordPress Dashboard](https://wordpress.org/plugins/ultimate-dashboard/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-dashboard/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-dashboard/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-dashboard/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-dashboard/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-dashboard/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [annaam](https://wordpress.org/support/users/annaam/)
 * Last activity: [2 months, 4 weeks ago](https://wordpress.org/support/topic/admin-menu-editor-array-warnings/#post-18838539)
 * Status: resolved