// 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
/** * Remove custom trial for existing members (when existing member changes levels/renews) * * title: Remove custom trial for existing memebrs. * layout: snippet * collection: checkout * category: membership-levels, trial * * You can add this recipe to…Continue reading
/** * Remove subscription delay for current or past members. This will remove all subscription delays from checkout for any level if the user is an active member or had a prior level (and is renewing). * * title: Subscription…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
add_filter( ‘admin_title’, function ( $admin_title, $title ) { return str_replace( ” — WordPress”, ”, $admin_title ); }, 10, 2 );Continue reading
add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading
add_filter( ‘wp_get_attachment_image_attributes’, function( $attr ) { if ( ! isset( $attr[‘loading’] ) || ‘lazy’ !== $attr[‘loading’] || ! isset( $attr[‘sizes’] ) ) { return $attr; } // Skip if attribute was already added. if ( false !== strpos( $attr[‘sizes’], ‘auto,’…Continue reading
add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $editor_settings[‘fontLibraryEnabled’] = false; return $editor_settings; } ); // Disable the REST API for the font library. add_filter( ‘register_post_type_args’, function( $arg, $post_type ) { if ( ‘wp_font_family’ === $post_type || ‘wp_font_face’ === $post_type ) {…Continue reading