WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#19521 closed defect (bug) (invalid)

wp_get_current_user() no longer returns object containing first_name and last_name properties — at Version 1

Reported by: beautomated Owned by:
Milestone: Priority: normal
Severity: major Version: 3.3
Component: Users Keywords:
Focuses: Cc:

Description (last modified by scribu)

When running wp_get_current_user() in v3.2 I get a 'data' property that contains the 'first_name' and 'last_name' properties. In 3.3 these properties no longer exist.

Here's what I get in 3.3 RC3:

object(WP_User)#210 (7) {
  ["data"]=>
  object(stdClass)#212 (10) {
    ["ID"]=>
    string(1) "2"
    ["user_login"]=>
    string(4) "sean"
    ["user_pass"]=>
    string(34) "$P$BlPvNE5m5xHprS1I0aPW5msjw/KLMy0"
    ["user_nicename"]=>
    string(4) "sean"
    ["user_email"]=>
    string(20) "sean@beautomated.com"
    ["user_url"]=>
    string(26) "http://www.beautomated.com"
    ["user_registered"]=>
    string(19) "2011-10-22 00:21:00"
    ["user_activation_key"]=>
    string(0) ""
    ["user_status"]=>
    string(1) "0"
    ["display_name"]=>
    string(4) "sean"
  }
  ["ID"]=>
  int(2)
  ["caps"]=>
  array(1) {
    ["administrator"]=>
    string(1) "1"
  }
  ["cap_key"]=>
  string(15) "wp_capabilities"
  ["roles"]=>
  array(1) {
    [0]=>
    string(13) "administrator"
  }
  ["allcaps"]=>
  array(63) {
    ["switch_themes"]=>
    bool(true)
    ["edit_themes"]=>
    bool(true)
    ["activate_plugins"]=>
    bool(true)
    ["edit_plugins"]=>
    bool(true)
    ["edit_users"]=>
    bool(true)
    ["edit_files"]=>
    bool(true)
    ["manage_options"]=>
    bool(true)
    ["moderate_comments"]=>
    bool(true)
    ["manage_categories"]=>
    bool(true)
    ["manage_links"]=>
    bool(true)
    ["upload_files"]=>
    bool(true)
    ["import"]=>
    bool(true)
    ["unfiltered_html"]=>
    bool(true)
    ["edit_posts"]=>
    bool(true)
    ["edit_others_posts"]=>
    bool(true)
    ["edit_published_posts"]=>
    bool(true)
    ["publish_posts"]=>
    bool(true)
    ["edit_pages"]=>
    bool(true)
    ["read"]=>
    bool(true)
    ["level_10"]=>
    bool(true)
    ["level_9"]=>
    bool(true)
    ["level_8"]=>
    bool(true)
    ["level_7"]=>
    bool(true)
    ["level_6"]=>
    bool(true)
    ["level_5"]=>
    bool(true)
    ["level_4"]=>
    bool(true)
    ["level_3"]=>
    bool(true)
    ["level_2"]=>
    bool(true)
    ["level_1"]=>
    bool(true)
    ["level_0"]=>
    bool(true)
    ["edit_others_pages"]=>
    bool(true)
    ["edit_published_pages"]=>
    bool(true)
    ["publish_pages"]=>
    bool(true)
    ["delete_pages"]=>
    bool(true)
    ["delete_others_pages"]=>
    bool(true)
    ["delete_published_pages"]=>
    bool(true)
    ["delete_posts"]=>
    bool(true)
    ["delete_others_posts"]=>
    bool(true)
    ["delete_published_posts"]=>
    bool(true)
    ["delete_private_posts"]=>
    bool(true)
    ["edit_private_posts"]=>
    bool(true)
    ["read_private_posts"]=>
    bool(true)
    ["delete_private_pages"]=>
    bool(true)
    ["edit_private_pages"]=>
    bool(true)
    ["read_private_pages"]=>
    bool(true)
    ["delete_users"]=>
    bool(true)
    ["create_users"]=>
    bool(true)
    ["unfiltered_upload"]=>
    bool(true)
    ["edit_dashboard"]=>
    bool(true)
    ["update_plugins"]=>
    bool(true)
    ["delete_plugins"]=>
    bool(true)
    ["install_plugins"]=>
    bool(true)
    ["update_themes"]=>
    bool(true)
    ["install_themes"]=>
    bool(true)
    ["update_core"]=>
    bool(true)
    ["list_users"]=>
    bool(true)
    ["remove_users"]=>
    bool(true)
    ["add_users"]=>
    bool(true)
    ["promote_users"]=>
    bool(true)
    ["edit_theme_options"]=>
    bool(true)
    ["delete_themes"]=>
    bool(true)
    ["export"]=>
    bool(true)
    ["administrator"]=>
    string(1) "1"
  }
  ["filter"]=>
  NULL
}

Change History (1)

comment:1 scribu2 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

See #18551 for explanation.

Note: See TracTickets for help on using tickets.