if ( ! is_admin() || ! function_exists( ‘get_current_screen’ ) ) return; $current_screen = get_current_screen(); if ( $current_screen && ‘profile’ === $current_screen->id ) { // Your code here } add_filter( “aioseo_user_profile_tab_disable”, “__return_true” );Continue reading
function modify_user_list_columns($columns) { if (!current_user_can(‘edit_users’)) { return $columns; } // Add our custom column right after the ‘pmpro_membership_level’ column. $new_columns = array(); $add_after = ‘pmpro_membership_level’; // Adjust if necessary. foreach ($columns as $key => $value) { $new_columns[$key] = $value; if…Continue reading
add_action(‘user_register’, ‘capture_user_registration_details’, 10, 1); function capture_user_registration_details($user_id) { $user_info = get_userdata($user_id); // Capture and store registration details $details = [ ‘First name’ => $user_info->first_name, ‘Last name’ => $user_info->last_name, ‘Email’ => $user_info->user_email, ]; // Store details in a transient, expire after 1…Continue reading
// Register the form field and save action only if the Code Snippets plugin is active if (function_exists(‘add_action’)) { // Show the new username field on the user profile page for admins add_action(‘edit_user_profile’, ‘custom_admin_edit_username_field’); // Save the new username if…Continue reading
add_action(‘admin_footer’, ‘hide_toolbar_checkbox_js’); function hide_toolbar_checkbox_js() { ?>Continue reading
add_action(‘admin_menu’, ‘add_custom_users_sorting_link_as_first’); function add_custom_users_sorting_link_as_first() { global $submenu; // Check if current user has the capability to list users if (!current_user_can(‘list_users’)) { return; } // Define the custom submenu item $custom_submenu_item = array( ‘Last Registered User’, // Menu title ‘list_users’, //…Continue reading
function hide_elements_in_profile_page() { $screen = get_current_screen(); // Check if the current screen is the profile or user edit screen if ( $screen->id == “profile” || $screen->id == “user-edit” ) { echo ‘ ‘; } } add_action(‘admin_head’, ‘hide_elements_in_profile_page’);Continue reading
function custom_admin_css() { echo ‘ ‘; } add_action(‘admin_head’, ‘custom_admin_css’);Continue reading
function custom_admin_styles_and_scripts() { ?>Continue reading
// Remove WordPress logo from the profile page for all users function remove_wp_logo_profile_page() { echo ‘ ‘; } add_action(‘admin_head’, ‘remove_wp_logo_profile_page’);Continue reading