-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
Describe the bug
I have a plugin that uses CMB2 to register an options page as a sub-menu of another custom admin page. This works in 2.7.0 but breaks the url in 2.8.0.
Steps to reproduce (I have confirmed I can reproduce this issue on the develop branch):
The following works with 2.7 producing an admin url with /wp-admin/admin.php?page=some_sub_page
but breaks in 2.8 producing an admin url with /wp-admin/some_sub_page
add_action( 'admin_menu', function() {
add_menu_page(
esc_html__( 'Some Page', 'textdomain' ),
esc_html__( 'Some Page', 'textdomain' ),
'edit_posts',
'some-page',
'prefix_render_admin_menu_page'
);
});
add_action( 'cmb2_admin_init', function() {
$cmb = new_cmb2_box( array(
'id' => 'some_sub_page_metabox',
'title' => __( 'Some Sub-Page', 'textdomain' ),
'object_types' => array( 'options-page' ),
'option_key' => 'some_sub_page',
'parent_slug' => 'some-page',
) );
});
function prefix_render_admin_menu_page() {
echo '<h1>Some Page</h1>';
}
Metadata
Metadata
Assignees
Labels
No labels