Category: Admin
Add ‘Internal Name (Nickname) Entry Field to WP Admin ‘Add New User’ Screen
// Inject Nickname and Company fields into Add New User screen add_action(‘user_new_form’, function($form_type) { if ($form_type !== ‘add-new-user’) return; ?>Continue reading
Hide Website Field from WP Admin ‘Add New User’ Screen
add_action(‘admin_footer-user-new.php’, function() { ?>Continue reading
Disable Spinner Buttons in Number Input Fields in WP Admin
add_action(‘admin_head’, function () { echo ‘ ‘; });Continue reading
Feed Generation Cron Script
/** * Product Feed Generation Cron Script */ // Start timing $start_time = microtime(true); // Simple logging function function log_message($message) { $timestamp = date(‘Y-m-d H:i:s’); $log_entry = “[$timestamp] $message”; error_log($log_entry); echo $log_entry . “\n”; } log_message(“Feed generation started”); try {…Continue reading
Fetch and Display AIOSEO Meta Data for a Specific Post
/** * WPCode Snippet: Display AIOSEO Meta Data for Post ID 323 * */ add_filter(‘the_content’, function($content) { // Only show on single post/page and for post ID 323 if (!is_singular() || get_the_ID() != 323) { return $content; } if (!function_exists(‘aioseo’))…Continue reading
wrong redirect .htaccess
# Slash al final RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !# RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ https://yourdomain.com/$1/ [L,R=301] # END Slash al finalContinue reading
Untitled Snippet
Hide Theme Footer Notice in Selected Admin Areas
add_action(‘admin_head’, function () { echo ‘ ‘; });Continue reading
Remove Specific Campaign Based on the Referral URL- v1
document.addEventListener(‘om.Campaign.startShow’, function(event) { if(document.referrer.search.indexOf(‘google.com’) > 0) { // replace with the specific referral domain var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID-holder’); // replace CAMPAIGN_ID with the unique ID for your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading