404 Logger

/** * Log 404 requests for pages/posts/assets, excluding admin or login areas. */ function log_public_404_requests() { // Only proceed if this is a 404 page on the front end if ( is_404() && ! is_admin() ) { $request_uri = $_SERVER[‘REQUEST_URI’]…Continue reading

EP Backfill Images – Admin Only

// Backfill missing featured images for Events // Runs only in Admin when dashboard loads add_action(‘admin_init’, function() { if ( ! current_user_can(‘manage_options’) ) { return; } $args = [ ‘post_type’ => ‘tribe_events’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 20, // small…Continue reading

Disable Automatic Updates Emails (copy)

// Disable auto-update emails. add_filter( ‘auto_core_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for plugins. add_filter( ‘auto_plugin_update_send_email’, ‘__return_false’ ); // Disable auto-update emails for themes. add_filter( ‘auto_theme_update_send_email’, ‘__return_false’ );Continue reading

Completely Disable Comments (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

PHP – Custom login

// === CUSTOM LOGIN PAGE === add_action(‘login_enqueue_scripts’, function () { echo ‘ ‘; }); // === LIEN DU LOGO DE CONNEXION === add_filter(‘login_headerurl’, fn() => ‘https://www.mdf.nc’); add_filter(‘login_headertext’, fn() => ‘MDF NC’);Continue reading