/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
// 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
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
// 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
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
// 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