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: https://develop.svn.wordpress.org/trunk@19374 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-11-21 15:35:57 +00:00
parent 969799b63a
commit 7c181a42bf
7 changed files with 19 additions and 11 deletions

View File

@ -10,6 +10,7 @@
require_once( './admin.php' ); require_once( './admin.php' );
$title = __( 'About' ); $title = __( 'About' );
$parent_file = 'about.php';
list( $display_version ) = explode( '-', $wp_version ); list( $display_version ) = explode( '-', $wp_version );

View File

@ -114,9 +114,10 @@ if ( is_network_admin() )
do_action('network_admin_notices'); do_action('network_admin_notices');
elseif ( is_user_admin() ) elseif ( is_user_admin() )
do_action('user_admin_notices'); do_action('user_admin_notices');
else elseif ( 'about' != $current_screen->parent_base )
do_action('admin_notices'); do_action('admin_notices');
if ( 'about' != $current_screen->parent_base )
do_action('all_admin_notices'); do_action('all_admin_notices');
if ( $parent_file == 'options-general.php' ) if ( $parent_file == 'options-general.php' )

View File

@ -10,6 +10,7 @@
require_once( './admin.php' ); require_once( './admin.php' );
$title = __( 'Credits' ); $title = __( 'Credits' );
$parent_file = 'about.php';
add_contextual_help($current_screen, add_contextual_help($current_screen,
'<p>' . __('Each name or handle is a link to that person&#8217;s profile in the WordPress.org community directory.') . '</p>' . '<p>' . __('Each name or handle is a link to that person&#8217;s profile in the WordPress.org community directory.') . '</p>' .

View File

@ -10,6 +10,7 @@
require_once( './admin.php' ); require_once( './admin.php' );
$title = __( 'Freedoms' ); $title = __( 'Freedoms' );
$parent_file = 'about.php';
list( $display_version ) = explode( '-', $wp_version ); list( $display_version ) = explode( '-', $wp_version );

View File

@ -16,16 +16,19 @@ elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true )
else else
wp_die( __('Invalid post type') ); wp_die( __('Invalid post type') );
if ( 'post' != $post_type ) { $post_type_object = get_post_type_object( $post_type );
$parent_file = "edit.php?post_type=$post_type";
$submenu_file = "post-new.php?post_type=$post_type"; if ( 'post' == $post_type ) {
} else {
$parent_file = 'edit.php'; $parent_file = 'edit.php';
$submenu_file = 'post-new.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; $title = $post_type_object->labels->add_new_item;
$editing = true; $editing = true;

View File

@ -34,8 +34,9 @@ get_header(); ?>
$metadata['width'], $metadata['width'],
$metadata['height'], $metadata['height'],
esc_url( get_permalink( $post->post_parent ) ), 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>' ); ?> <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta --> </div><!-- .entry-meta -->

View File

@ -283,9 +283,9 @@ function remove_all_filters($tag, $priority = false) {
if( isset($wp_filter[$tag]) ) { if( isset($wp_filter[$tag]) ) {
if( false !== $priority && isset($wp_filter[$tag][$priority]) ) if( false !== $priority && isset($wp_filter[$tag][$priority]) )
unset($wp_filter[$tag][$priority]); $wp_filter[$tag][$priority] = array();
else else
unset($wp_filter[$tag]); $wp_filter[$tag] = array();
} }
if( isset($merged_filters[$tag]) ) if( isset($merged_filters[$tag]) )