Category: Admin
header
Untitled Snippet
Hide JSM HPOS Order Metadata Box Unless for Rosso Digital
add_action(‘admin_head’, function () { $current_user = wp_get_current_user(); if (strpos($current_user->user_email, ‘rosso-digital’) === false) { echo ‘ ‘; } });Continue reading
Hide JSM User Metadata Box Unless for Rosso Digital
add_action(‘admin_head’, function () { $current_user = wp_get_current_user(); if (strpos($current_user->user_email, ‘rosso-digital’) === false) { echo ‘ ‘; } });Continue reading
Add ‘Logged-In Admin’ Rule Option to ACF Pro
// 1. Register the rule under the ‘User’ group add_filter(‘acf/location/rule_types’, function($choices) { $choices[‘User’][‘logged_in_admin’] = ‘Logged-In Admin’; return $choices; }); // 2. Limit to only valid operators for dropdown-based values add_filter(‘acf/location/rule_operators/logged_in_admin’, function($choices) { return [ ‘==’ => ‘is equal to’, ‘!=’…Continue reading
Lifter_DIR_AB_ACF – LifterLMS Content ACF Fields – Course-Focused Version with Edit Links
/** * LifterLMS Content ACF Fields – Course-Focused Version with Edit Links * Registers ACF fields for COURSE records with comprehensive detail textareas * Includes direct edit and reporting links similar to Gravity Forms implementation * WPCode Snippet – Run…Continue reading
LIFTER _DIR_AA_CPT – LifterLMS Content CPT Registration
/** * LifterLMS Content CPT Registration * Registers custom post type for LifterLMS course content synchronization * WPCode Snippet – Run Everywhere – Priority 0 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘init’, function () { $labels = [ ‘name’…Continue reading
Admin Privileges Being Returned
add_action(‘init’, function () { if (current_user_can(‘administrator’)) { $role = get_role(‘administrator’); if ($role) { // Capabilities related to editing pages, posts, and more $capabilities = [ ‘edit_posts’, ‘edit_others_posts’, ‘edit_published_posts’, ‘edit_pages’, ‘edit_others_pages’, ‘edit_published_pages’, ‘publish_posts’, ‘publish_pages’, ‘delete_posts’, ‘delete_others_posts’, ‘delete_published_posts’, ‘delete_pages’, ‘delete_others_pages’, ‘delete_published_pages’, ‘read’,…Continue reading
Custom hyperlinks
/* ========================================================================== WPCODE CUSTOM HYPERLINK STYLES Add this CSS code to WPCode as a “CSS Snippet” ========================================================================== */ /* Default link styles – applies to all links */ a { color: #0073aa; /* Link color – change to your preferred…Continue reading