Skip to content

Commit

Permalink
updates deprecated get_currentuserinfo to wp_get_current_user for WP …
Browse files Browse the repository at this point in the history
…v. 4.5 and higher as listed in issue WPBuddy#844
  • Loading branch information
MsPseudolus committed Jul 11, 2016
1 parent 003ed80 commit 7d7ea25
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inc/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,13 @@ function largo_edit_permission_check() {
global $current_user, $profileuser;

$screen = get_current_screen();

wp_get_current_user();

global $wp_version;
if ( !substr( $wp_version, 0, 3 ) === "4.5" ) {
get_currentuserinfo();
} else {
wp_get_current_user();
}

if( ! is_super_admin( $current_user->ID ) && in_array( $screen->base, array( 'user-edit', 'user-edit-network' ) ) ) { // editing a user profile
if ( is_super_admin( $profileuser->ID ) ) { // trying to edit a superadmin while less than a superadmin
Expand Down

0 comments on commit 7d7ea25

Please sign in to comment.