'; if ($echo) { echo $nonce_field; } return $nonce_field; } } if (!function_exists('wp_nonce_url')) { /** * Retrieve URL with nonce added to URL query */ function wp_nonce_url(string $actionurl, int|string $action = -1, string $name = '_wpnonce'): string { return $actionurl . '?' . $name . '=mock_nonce'; } } if (!function_exists('wp_create_nonce')) { /** * Creates a cryptographic token tied to a specific action, user, user session */ function wp_create_nonce(int|string $action = -1): string { return 'mock_nonce_' . $action; } } // WordPress internationalization functions if (!function_exists('_e')) { /** * Displays translated text */ function _e(string $text, string $domain = 'default'): void { echo $text; } } if (!function_exists('_n')) { /** * Translates and retrieves the singular or plural form based on the supplied number */ function _n(string $single, string $plural, int $number, string $domain = 'default'): string { return $number === 1 ? $single : $plural; } } if (!function_exists('_x')) { /** * Translates string with gettext context */ function _x(string $text, string $context, string $domain = 'default'): string { return $text; } } if (!function_exists('esc_attr__')) { /** * Retrieves the translation of $text and escapes it for safe use in an attribute */ function esc_attr__(string $text, string $domain = 'default'): string { return esc_attr($text); } } if (!function_exists('esc_attr')) { /** * Escaping for HTML attributes */ function esc_attr(string $text): string { return htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); } } echo "PHPStan WordPress Bootstrap Complete\n";