mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Fix admin_body_class filter for Menu's and Widgets pages, Include the filter in Iframe's. Props SergeyBiryukov & johnbillion. Fixes #18853
git-svn-id: http://svn.automattic.com/wordpress/trunk@18882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
725bcef080
commit
5ad995f089
@ -1351,7 +1351,6 @@ function iframe_header( $title = '', $limit_styles = false ) {
|
|||||||
show_admin_bar( false );
|
show_admin_bar( false );
|
||||||
global $hook_suffix, $current_screen, $current_user, $admin_body_class, $wp_locale;
|
global $hook_suffix, $current_screen, $current_user, $admin_body_class, $wp_locale;
|
||||||
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||||
$admin_body_class .= ' iframe';
|
|
||||||
|
|
||||||
?><!DOCTYPE html>
|
?><!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
||||||
@ -1389,7 +1388,7 @@ do_action("admin_head-$hook_suffix");
|
|||||||
do_action('admin_head');
|
do_action('admin_head');
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="no-js <?php echo $admin_body_class; ?>">
|
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-admin no-js iframe <?php echo apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class; ?>">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
(function(){
|
(function(){
|
||||||
|
@ -432,12 +432,12 @@ $_wp_nav_menu_max_depth = 0;
|
|||||||
if ( is_nav_menu( $nav_menu_selected_id ) )
|
if ( is_nav_menu( $nav_menu_selected_id ) )
|
||||||
$edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
|
$edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
|
||||||
|
|
||||||
function wp_nav_menu_max_depth() {
|
function wp_nav_menu_max_depth($classes) {
|
||||||
global $_wp_nav_menu_max_depth;
|
global $_wp_nav_menu_max_depth;
|
||||||
return "menu-max-depth-$_wp_nav_menu_max_depth";
|
return "$classes menu-max-depth-$_wp_nav_menu_max_depth";
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action('admin_body_class','wp_nav_menu_max_depth');
|
add_filter('admin_body_class', 'wp_nav_menu_max_depth');
|
||||||
|
|
||||||
wp_nav_menu_setup();
|
wp_nav_menu_setup();
|
||||||
wp_initial_nav_menu_meta_boxes();
|
wp_initial_nav_menu_meta_boxes();
|
||||||
|
@ -21,8 +21,12 @@ if ( isset($_GET['widgets-access']) ) {
|
|||||||
set_user_setting( 'widgets_access', $widgets_access );
|
set_user_setting( 'widgets_access', $widgets_access );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wp_widgets_access_body_class($classes) {
|
||||||
|
return "$classes widgets_access ";
|
||||||
|
}
|
||||||
|
|
||||||
if ( 'on' == $widgets_access )
|
if ( 'on' == $widgets_access )
|
||||||
add_filter( 'admin_body_class', create_function('', '{return " widgets_access ";}') );
|
add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
|
||||||
else
|
else
|
||||||
wp_enqueue_script('admin-widgets');
|
wp_enqueue_script('admin-widgets');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user