Disable Password Reset

// Disable Password Reset Functionality function disable_password_reset() { return false; } add_filter(‘allow_password_reset’, ‘disable_password_reset’); // Remove “Lost Your Password?” Link function remove_lostpassword_text($text) { if ($text == ‘Lost your password?’) { $text = ”; } return $text; } add_filter(‘gettext’, ‘remove_lostpassword_text’); // Block…Continue reading

Restrict Dashboard Access

function restrict_dashboard_access() { // Allow AJAX requests to proceed if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) { return; } // Check if user is not an administrator if ( ! current_user_can( ‘administrator’ ) && is_admin() ) { wp_redirect( home_url()…Continue reading

Show User ID

// 1. Add the ID column after the Username column function add_user_id_column($columns) { $new_columns = array(); foreach ($columns as $key => $value) { $new_columns[$key] = $value; // Insert ‘user_id’ column right after ‘username’ if ($key === ‘username’) { $new_columns[‘user_id’] =…Continue reading

List Media Information

// 1. Add Columns to Media Library function add_media_library_columns( $columns ) { $columns[‘media_format’] = ‘Format’; $columns[‘dimensions’] = ‘Dimensions’; $columns[‘file_size’] = ‘File Size’; return $columns; } add_filter( ‘manage_media_columns’, ‘add_media_library_columns’ ); // 2. Display Data in Columns function display_media_library_column_data( $column_name, $post_id )…Continue reading

Reorder Post Column

add_filter(‘manage_posts_columns’, ‘reorder_admin_columns’); function reorder_admin_columns($columns) { $n_columns = array(); $move = ‘author’; // Column to move $before = ‘title’; // Move before this column foreach($columns as $key => $value) { if ($key == $before) { $n_columns[$move] = $move; } $n_columns[$key] =…Continue reading