[wp-trac] [WordPress Trac] #46081: get_admin_page_title() returns nothing

WordPress Trac noreply at wordpress.org
Mon Jun 15 20:03:04 UTC 2020


#46081: get_admin_page_title() returns nothing
----------------------------+-----------------------------
 Reporter:  grapestain      |       Owner:  valentinbora
     Type:  defect (bug)    |      Status:  accepted
 Priority:  normal          |   Milestone:  5.5
Component:  Administration  |     Version:  5.0.3
 Severity:  minor           |  Resolution:
 Keywords:  has-patch       |     Focuses:  administration
----------------------------+-----------------------------
Changes (by audrasjb):

 * keywords:  dev-feedback 2nd-opinion => has-patch


Comment:

 This patch can be tested using this snippet.

 {{{#!php
 <?php
 function my_option_page() {
         add_menu_page( 'My option page', 'My option page',
 'manage_options', 'my_option_page', 'my_option_page_callback' );
 }
 add_action( 'admin_menu', 'my_option_page' );

 function my_option_page_callback() {
         echo '<h1>' . get_admin_page_title() . '</h1>';
 }

 }}}

 It should display the same H1 text with the Menu page title on both `wp-
 admin/admin.php?page=montheme_menu_admin` and `wp-
 admin/options.php?page=montheme_menu_admin` screens.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46081#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list