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
add_action(‘admin_notices’, ‘check_for_duplicate_full_names’); function check_for_duplicate_full_names() { $screen = get_current_screen(); // Check if we are on the Users page if ($screen->id !== ‘users’) { return; } global $wpdb; // SQL query to find duplicate first and last names $query = “SELECT meta_value…Continue reading
/** * Plugin Name: Shop Manager To-Do List * Description: Adds a custom to-do list feature for shop managers in the WordPress admin. * Version: 1.0 * Author: Your Name */ // Register custom post type for To-Dos function create_todo_post_type()…Continue reading
// Delete Expired Coupons that have an expiration date set and are not from AutomateWoo add_action(‘delete_expired_coupons_hook’, ‘delete_expired_coupons_action’); function delete_expired_coupons_action() { $query_args = [ ‘fields’ => ‘ids’, ‘post_type’ => ‘shop_coupon’, ‘post_status’ => ‘any’, ‘posts_per_page’ => -1, ‘orderby’ => ‘date’, ‘order’ =>…Continue reading
add_filter( ‘manage_posts_columns’, function ( $columns ) { // You can change this to any other position by changing ‘title’ to the name of the column you want to put it after. $move_after = ‘title’; $move_after_key = array_search( $move_after, array_keys( $columns…Continue reading
// Hide the admin ‘Screen Options’ tab add_filter(‘screen_options_show_screen’, ‘__return_false’);Continue reading