function convert_to_webp($file) { $file_path = $file[‘file’]; $file_type = $file[‘type’]; // Only for JPEG, PNG, and GIF images if (in_array($file_type, [‘image/jpeg’, ‘image/png’, ‘image/gif’, ‘image/jpg’])) { $webp_path = preg_replace(‘/.(jpe?g|png|gif)$/i’, ‘.webp’, $file_path); // Check if the GD library is available if (!function_exists(‘gd_info’)) {…Continue reading
if ( ! is_ssl() ) { wp_redirect( ‘https://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’], 301 ); exit(); }Continue reading
add_filter( ‘wp_mail’, function ( $args ) { // Add the BCC email address here $bcc_address = ‘Bcc: [email protected]’; if ( ! empty( $args[ ‘headers’ ] ) ) { if ( ! is_array( $args[ ‘headers’ ] ) ) { $args[ ‘headers’…Continue reading
/** * Disable the password change notification email. * – Prevents admin notifications when users change their passwords. */ add_filter(‘wp_password_change_notification_email’, ‘__return_false’);Continue reading
/** * Add custom CSS styles for the WordPress login page. * – Styles include a custom registration button and login field adjustments. */ function add_custom_login_styles() { echo ‘ ‘; } add_action(‘login_head’, ‘add_custom_login_styles’); /** * Disable the language dropdown on…Continue reading
function buddyboss_theme_child_languages() { load_theme_textdomain(‘buddyboss-theme’, get_stylesheet_directory() . ‘/languages’); } add_action(‘after_setup_theme’, ‘buddyboss_theme_child_languages’);Continue reading
add_filter(‘charitable_donation_summary’, ‘charitable_custom_donation_summary’, 10, 4 ); /** * Custom donation summary output. * * @param string $ret The default donation summary output. * @param Charitable_Campaign $campaign The campaign object. * @param int $amount The amount raised. * @param int $goal The…Continue reading
/* 1. Use a more-intuitive box-sizing model */ *, *::before, *::after { box-sizing: border-box; } /* 2. Remove default margin */ * { margin: 0; } body { /* 3. Add accessible line-height */ line-height: 1.5; /* 4. Improve text…Continue reading
function generate_photai_image() { // Check if the ‘prompt’ parameter is provided if (!isset($_POST[‘prompt’]) || empty(trim($_POST[‘prompt’]))) { wp_send_json_error([‘message’ => ‘Prompt is required.’]); return; } // Retrieve and validate additional styling information $style = isset($_POST[‘style’]) ? sanitize_text_field($_POST[‘style’]) : ‘cinematic’; // Retrieve and…Continue reading
function generate_freepik_image() { // Vérification du paramètre ‘prompt’ if (!isset($_POST[‘prompt’]) || empty(trim($_POST[‘prompt’]))) { wp_send_json_error([‘message’ => ‘Prompt is required.’]); return; } // Récupération et validation des données de style $style = isset($_POST[‘style’]) ? sanitize_text_field($_POST[‘style’]) : ‘photo’; $color = isset($_POST[‘color’]) ? sanitize_text_field($_POST[‘color’])…Continue reading