Check $pagenow?post_type=$typenow for submenu titles, Fixes page titles for plugin pages added to custom post_type's. Fixes #12985
git-svn-id: https://develop.svn.wordpress.org/trunk@14126 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
632de8561e
commit
2d50f72462
|
@ -1242,6 +1242,7 @@ function get_admin_page_title() {
|
||||||
global $submenu;
|
global $submenu;
|
||||||
global $pagenow;
|
global $pagenow;
|
||||||
global $plugin_page;
|
global $plugin_page;
|
||||||
|
global $typenow;
|
||||||
|
|
||||||
if ( ! empty ( $title ) )
|
if ( ! empty ( $title ) )
|
||||||
return $title;
|
return $title;
|
||||||
|
@ -1271,7 +1272,13 @@ function get_admin_page_title() {
|
||||||
foreach ( $submenu[$parent] as $submenu_array ) {
|
foreach ( $submenu[$parent] as $submenu_array ) {
|
||||||
if ( isset( $plugin_page ) &&
|
if ( isset( $plugin_page ) &&
|
||||||
( $plugin_page == $submenu_array[2] ) &&
|
( $plugin_page == $submenu_array[2] ) &&
|
||||||
(($parent == $pagenow ) || ($parent == $plugin_page ) || ($plugin_page == $hook ) || (($pagenow == 'admin.php' ) && ($parent1 != $submenu_array[2] ) ) )
|
(
|
||||||
|
( $parent == $pagenow ) ||
|
||||||
|
( $parent == $plugin_page ) ||
|
||||||
|
( $plugin_page == $hook ) ||
|
||||||
|
( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
|
||||||
|
( !empty($typenow) && $parent == $pagenow . '?post_type=' . $typenow)
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
$title = $submenu_array[3];
|
$title = $submenu_array[3];
|
||||||
return $submenu_array[3];
|
return $submenu_array[3];
|
||||||
|
@ -1330,7 +1337,6 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
|
||||||
$page_type = $admin_page_hooks[$parent];
|
$page_type = $admin_page_hooks[$parent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$plugin_name = preg_replace( '!\.php!', '', $plugin_page );
|
$plugin_name = preg_replace( '!\.php!', '', $plugin_page );
|
||||||
|
|
||||||
return $page_type . '_page_' . $plugin_name;
|
return $page_type . '_page_' . $plugin_name;
|
||||||
|
|
Loading…
Reference in New Issue