always_collapse_admin_menu
function always_collapse_admin_menu() { add_action(‘admin_head’, function() { ?>Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function always_collapse_admin_menu() { add_action(‘admin_head’, function() { ?>Continue reading
// Populate the new column with the nickname data for each user function show_player_name_column_content($value, $column_name, $user_id) { if (‘player_name’ == $column_name) { $user_info = get_userdata($user_id); return $user_info->nickname; // Assuming the nickname field is used for the player name } return…Continue reading
function custom_change_registration_label() { ?>Continue reading
function hide_display_name_dropdown_css() { // Target the user edit and profile pages $screen = get_current_screen(); if ( $screen->id == “profile” || $screen->id == “user-edit” ) { echo ‘ ‘; } } add_action(‘admin_head’, ‘hide_display_name_dropdown_css’);Continue reading
// Removes the SEO from admin bar. add_filter( ‘aioseo_show_in_admin_bar’, ‘__return_false’ );Continue reading
function extend_user_search($wp_user_query) { if (!is_admin() || strpos($wp_user_query->query_where, ‘@’) !== false) { return; } if (empty($_GET[“s”])) { return; } global $wpdb; $search_term = sanitize_text_field($_GET[“s”]); $search_terms = explode(‘ ‘, $search_term); // Prepare the search term for a LIKE query. $search_term_like = ‘%’…Continue reading
// Add custom JavaScript to hide the “Source” column in the user list function hide_source_column_script() { ?>Continue reading
// Add new column to the Users page in WP Admin, right after the username function add_player_name_column_next_to_username($columns) { $new_columns = []; foreach ($columns as $key => $title) { $new_columns[$key] = $title; if ($key == ‘username’) { // Insert the Player…Continue reading
function custom_admin_logo() { $image_url = get_site_url() . ‘/wp-content/uploads/2024/04/elementor.png’; // Make sure the path is correct echo ” “; } add_action(‘admin_head’, ‘custom_admin_logo’);Continue reading
add_action(‘admin_footer’, ‘duplicate_names_click_handler’); function duplicate_names_click_handler() { // Only add this script on the Users page to avoid unnecessary loading on other admin pages. $current_screen = get_current_screen(); if ($current_screen && ‘users’ === $current_screen->id) : ?>Continue reading