[Admin] – Manage clinic locations

// Register menus add_action(‘admin_menu’, ‘register_vtc_form_menus’); function register_vtc_form_menus() { add_menu_page(‘VTC Form’, ‘VTC Form’, ‘manage_options’, ‘vtc_form’, ‘display_vtc_form_admin_page’, ‘dashicons-forms’, 6); add_submenu_page(‘vtc_form’, ‘Manage Clinics’, ‘Manage Clinics’, ‘manage_options’, ‘vtc_form_clinics’, ‘display_vtc_form_clinics_page’); } // Display the main admin page content function display_vtc_form_admin_page() { if (!current_user_can(‘manage_options’)) return; echo…Continue reading

Disable administrator role checkbox

function disable_administrator_role_checkbox() { $current_user = wp_get_current_user(); $current_user_roles = (array) $current_user->roles; // Check if the current user is an administrator if (in_array(‘administrator’, $current_user_roles)) { ?>Continue reading

Add custom submenu page for restricted name change users

// Add custom submenu page for restricted name change users function add_restricted_name_change_users_submenu_page() { add_submenu_page( ‘users.php’, // parent slug __(‘Restricted Name Change Users’), // page title __(‘Restricted Name Change Users’), // menu title ‘manage_options’, // capability ‘restricted_name_change_users’, // menu slug ‘display_restricted_name_change_users’…Continue reading

Remove color scheme options

function remove_color_scheme_options() { remove_action(‘admin_color_scheme_picker’, ‘admin_color_scheme_picker’); } add_action(‘admin_init’, ‘remove_color_scheme_options’);Continue reading

Hide SEO tab link

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

Add Membership end column in user list

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

Admin Editable Usernames

// 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 custom users list in menu

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