WordPress.org

Make WordPress Core

Changeset 6700


Ignore:
Timestamp:
01/31/2008 10:03:48 PM (10 years ago)
Author:
ryan
Message:

Fix profile submenu highlight. Make is_profile_page a constant so that register globals can't manipulate it. see #5736

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/profile-update.php

    r6699 r6700  
    22
    33require_once('admin.php');
    4 
    5 $parent_file = 'profile.php';
    6 $submenu_file = 'profile.php';
    74
    85check_admin_referer('update-profile_' . $user_ID);
  • trunk/wp-admin/profile.php

    r6697 r6700  
    11<?php
    2 $is_profile_page = true;
     2define('IS_PROFILE_PAGE', true);
    33require_once('user-edit.php');
    44?>
  • trunk/wp-admin/user-edit.php

    r6697 r6700  
    11<?php
    2 
    3 $is_profile_page = isset($is_profile_page) && $is_profile_page? true : false;
    42
    53require_once('admin.php');
     4
     5if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE )
     6    $is_profile_page = true;
     7else
     8    $is_profile_page = false;
    69
    710function profile_js ( ) {
     
    5356$title = $is_profile_page? __('Profile') : __('Edit User');
    5457if ( current_user_can('edit_users') && !$is_profile_page )
    55     $parent_file = 'users.php';
     58    $submenu_file = 'users.php';
    5659else
    57     $parent_file = 'profile.php';
    58 $submenu_file = 'users.php';
     60    $submenu_file = 'profile.php';
     61$parent_file = 'users.php';
    5962
    6063wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
Note: See TracChangeset for help on using the changeset viewer.