Fix profile submenu highlight. Make is_profile_page a constant so that register globals can't manipulate it. see #5736
git-svn-id: http://svn.automattic.com/wordpress/trunk@6700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
78e80be72f
commit
7db4c0ad2c
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
$parent_file = 'profile.php';
|
|
||||||
$submenu_file = 'profile.php';
|
|
||||||
|
|
||||||
check_admin_referer('update-profile_' . $user_ID);
|
check_admin_referer('update-profile_' . $user_ID);
|
||||||
|
|
||||||
if ( !$_POST )
|
if ( !$_POST )
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
$is_profile_page = true;
|
define('IS_PROFILE_PAGE', true);
|
||||||
require_once('user-edit.php');
|
require_once('user-edit.php');
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$is_profile_page = isset($is_profile_page) && $is_profile_page? true : false;
|
|
||||||
|
|
||||||
require_once('admin.php');
|
require_once('admin.php');
|
||||||
|
|
||||||
|
if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE )
|
||||||
|
$is_profile_page = true;
|
||||||
|
else
|
||||||
|
$is_profile_page = false;
|
||||||
|
|
||||||
function profile_js ( ) {
|
function profile_js ( ) {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -52,10 +55,10 @@ if ( $is_profile_page ) {
|
||||||
|
|
||||||
$title = $is_profile_page? __('Profile') : __('Edit User');
|
$title = $is_profile_page? __('Profile') : __('Edit User');
|
||||||
if ( current_user_can('edit_users') && !$is_profile_page )
|
if ( current_user_can('edit_users') && !$is_profile_page )
|
||||||
$parent_file = 'users.php';
|
$submenu_file = 'users.php';
|
||||||
else
|
else
|
||||||
$parent_file = 'profile.php';
|
$submenu_file = 'profile.php';
|
||||||
$submenu_file = 'users.php';
|
$parent_file = 'users.php';
|
||||||
|
|
||||||
wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
|
wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue