Set $parent_file for post-new.php when show_in_menu is a file. Provides for correct top-level highlighting. $submenu_file remains set to expect a post-new.php menu. see #19125.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
73f0f40e2a
commit
5e69bd0caf
|
@ -10,6 +10,7 @@
|
|||
require_once( './admin.php' );
|
||||
|
||||
$title = __( 'About' );
|
||||
$parent_file = 'about.php';
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
|
|
|
@ -114,10 +114,11 @@ if ( is_network_admin() )
|
|||
do_action('network_admin_notices');
|
||||
elseif ( is_user_admin() )
|
||||
do_action('user_admin_notices');
|
||||
else
|
||||
elseif ( 'about' != $current_screen->parent_base )
|
||||
do_action('admin_notices');
|
||||
|
||||
do_action('all_admin_notices');
|
||||
if ( 'about' != $current_screen->parent_base )
|
||||
do_action('all_admin_notices');
|
||||
|
||||
if ( $parent_file == 'options-general.php' )
|
||||
require(ABSPATH . 'wp-admin/options-head.php');
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
require_once( './admin.php' );
|
||||
|
||||
$title = __( 'Credits' );
|
||||
$parent_file = 'about.php';
|
||||
|
||||
add_contextual_help($current_screen,
|
||||
'<p>' . __('Each name or handle is a link to that person’s profile in the WordPress.org community directory.') . '</p>' .
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
require_once( './admin.php' );
|
||||
|
||||
$title = __( 'Freedoms' );
|
||||
$parent_file = 'about.php';
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
|
|
|
@ -16,16 +16,19 @@ elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true )
|
|||
else
|
||||
wp_die( __('Invalid post type') );
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "post-new.php?post_type=$post_type";
|
||||
} else {
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
|
||||
if ( 'post' == $post_type ) {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = 'post-new.php';
|
||||
} else {
|
||||
if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
|
||||
$parent_file = $post_type_object->show_in_menu;
|
||||
else
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "post-new.php?post_type=$post_type";
|
||||
}
|
||||
|
||||
$post_type_object = get_post_type_object($post_type);
|
||||
|
||||
$title = $post_type_object->labels->add_new_item;
|
||||
|
||||
$editing = true;
|
||||
|
|
|
@ -34,8 +34,9 @@ get_header(); ?>
|
|||
$metadata['width'],
|
||||
$metadata['height'],
|
||||
esc_url( get_permalink( $post->post_parent ) ),
|
||||
get_the_title( $post->post_parent )
|
||||
$blah = get_the_title( $post->post_parent )
|
||||
);
|
||||
var_dump( $blah );
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
|
|
@ -283,9 +283,9 @@ function remove_all_filters($tag, $priority = false) {
|
|||
|
||||
if( isset($wp_filter[$tag]) ) {
|
||||
if( false !== $priority && isset($wp_filter[$tag][$priority]) )
|
||||
unset($wp_filter[$tag][$priority]);
|
||||
$wp_filter[$tag][$priority] = array();
|
||||
else
|
||||
unset($wp_filter[$tag]);
|
||||
$wp_filter[$tag] = array();
|
||||
}
|
||||
|
||||
if( isset($merged_filters[$tag]) )
|
||||
|
|
Loading…
Reference in New Issue