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

FC – Permitir subidas SVG

// Permitir subida de SVG en la biblioteca de medios add_filter(‘upload_mimes’, function ($mimes) { $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘svgz’] = ‘image/svg+xml’; return $mimes; });Continue reading

Outseta Subdomain Backend Checker

add_action(‘wp_ajax_check_subdomain’, ‘check_subdomain_handler’); add_action(‘wp_ajax_nopriv_check_subdomain’, ‘check_subdomain_handler’); add_action(‘rest_api_init’, function () { register_rest_route(‘custom/v1’, ‘/trigger-deploy’, [ ‘methods’ => ‘POST’, ‘callback’ => ‘rmm_trigger_deploy’, ‘permission_callback’ => ‘__return_true’, // Replace with real auth in production ]); }); error_log(“✅ check_subdomain_handler called: ” . date(‘c’)); function rmm_trigger_deploy($request) { $params =…Continue reading

rmm_container_table

// Register AJAX handlers add_action(‘wp_ajax_rmm_container_action’, ‘handle_rmm_container_action’); add_action(‘wp_ajax_nopriv_rmm_container_action’, ‘handle_rmm_container_action’); function handle_rmm_container_action() { $rmm_action = sanitize_text_field($_POST[‘rmm_action’]); $outseta_uid = isset($_POST[‘outseta_uid’]) ? sanitize_text_field($_POST[‘outseta_uid’]) : ”; $subdomain = isset($_POST[‘subdomain’]) ? sanitize_text_field($_POST[‘subdomain’]) : ”; $response = array(‘success’ => false, ‘message’ => ‘Unknown action’); if ($rmm_action ===…Continue reading

Normalize CSS (The New Normal)

if ( ! function_exists( ‘enqueue_custom_styles’ ) ) { function enqueue_custom_styles() { // Normalize wp_register_style( ‘the-new-normal-css’, ‘https://cdn.jsdelivr.net/gh/sarahschopick/the-new-normal.css@main/the-new-normal.min.css’, array(), ‘1.0.0’ ); wp_enqueue_style( ‘the-new-normal-css’ ); // WordPress Normalization wp_register_style( ‘normalize-wordpress’, ‘https://cdn.jsdelivr.net/gh/sarahschopick/normalize-wordpress@main/normalize-wordpress.min.css’, array(), ‘1.0.0’ ); wp_enqueue_style( ‘normalize-wordpress’ ); } } add_action( ‘wp_enqueue_scripts’, ‘enqueue_custom_styles’ );Continue reading

Login Restrict

// Restrict login to only the senior developer by user ID function restrict_login_to_senior_dev( $user, $username, $password ) { // Allow login only for the specified user ID $allowed_user_id = 1; // Replace with your user ID (e.g., 1, 2, etc.)…Continue reading

inkt CRM to Fluent Forms Autofill – Person_id

// Author: Sumaiya, anytype doc: anytype://object?objectId=bafyreiemzcszvrirdfznkbgehn3q27ayd6djlvj7rtvyhk6sue6w2diccq&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv /** * inkt CRM to Fluent Forms Autofill (Flowmattic Secure Connection) * * HOW IT WORKS: * 1. This script runs only when ‘project_id’ and ‘person_id’ are in the URL. * 2. It takes…Continue reading

Enable HTTP Strict Transport Security (HSTS)

/** * Enables the HTTP Strict Transport Security (HSTS) header in WordPress. * Includes preloading with subdomain support. */ function tg_enable_strict_transport_security_hsts_header_wordpress() { header( ‘Strict-Transport-Security: max-age=31536000; includeSubDomains; preload’ ); } add_action( ‘send_headers’, ‘tg_enable_strict_transport_security_hsts_header_wordpress’ );Continue reading

Post Shortcodes

// Post Title Shortcode function shortcode_post_title() { return get_the_title(); } add_shortcode(‘post_title’, ‘shortcode_post_title’); // Featured Image Shortcode function shortcode_featured_image() { if (has_post_thumbnail()) { return get_the_post_thumbnail(null, ‘full’); } return ”; } add_shortcode(‘featured_image’, ‘shortcode_featured_image’); // Excerpt Shortcode function shortcode_post_excerpt() { global $post; return…Continue reading