/** * NIRMAKO Dynamic Event Schema (JSON-LD) – FULL * Covers: startDate, endDate, location, image, description, * organizer(+url), performer, eventStatus, offers(url/validFrom/price) */ function nirmako_next_monday_datetime($hour = 10, $minute = 0, $tz = ‘Asia/Jerusalem’) { $dt = new DateTime(‘now’, new DateTimeZone($tz)); $dt->setTime($hour,…Continue reading
add_action( ‘woocommerce_email_before_order_table’, ‘conditionally_remove_coupon_section_from_email’, 5, 4 ); function conditionally_remove_coupon_section_from_email( $order, $sent_to_admin, $plain_text, $email ) { if ( ! $order instanceof WC_Order ) { return; } // Get applied coupons $coupons = $order->get_coupon_codes(); // If NO coupons were used, remove the coupon…Continue reading
/** * Always force noindex on: * – Password-protected posts/pages (even after password is entered) * – Private posts/pages * Compatible with Rank Math, Yoast SEO, and AIOSEO */ function vb_should_force_noindex() { global $post; if ( ! $post ) {…Continue reading
/** * Enhances AIOSEO HTML Sitemap: * – Links CPT headings to their archive URLs (including Blog) * – Moves the “Posts” section right after “Pages” * – Preserves all AIOSEO settings, filters, and structure * * Fixed bugs: *…Continue reading
add_action(‘wp_ajax_telecharger_pdf_statuts’, ‘mfstatuts_dl_pdf’); add_action(‘wp_ajax_nopriv_telecharger_pdf_statuts’, ‘mfstatuts_dl_pdf’); add_action(‘wp_ajax_envoyer_simulation_email’, ‘mfstatuts_send_mail’); add_action(‘wp_ajax_nopriv_envoyer_simulation_email’, ‘mfstatuts_send_mail’); function mfstatuts_get_taux() { return array( ‘ae’ => array( ‘services’ => array(‘taux’ => 0.218, ‘acre’ => 0.109, ‘abat’ => 0.50, ‘plaf’ => 77700), ‘commerciale’ => array(‘taux’ => 0.128, ‘acre’ => 0.064, ‘abat’ =>…Continue reading
add_shortcode(‘nws_weather’, function () { $lat = ‘38.8977’; $lon = ‘-77.0365’; // Fetch NWS data $meta = wp_remote_get(“https://api.weather.gov/points/{$lat},{$lon}”); if (is_wp_error($meta)) return ‘Weather unavailable.’; $meta_data = json_decode(wp_remote_retrieve_body($meta), true); if (!$meta_data || empty($meta_data[‘properties’])) return ‘Invalid location.’; $forecast_url = $meta_data[‘properties’][‘forecast’]; $zone = basename($meta_data[‘properties’][‘forecastZone’]); $station_url…Continue reading
add_shortcode(‘current_weather_nav’, function () { $lat = ‘38.8977’; // Update this to your location $lon = ‘-77.0365’; // Fetch point metadata $meta = wp_remote_get(“https://api.weather.gov/points/{$lat},{$lon}”); if (is_wp_error($meta)) return ”; $meta_data = json_decode(wp_remote_retrieve_body($meta), true); if (empty($meta_data[‘properties’])) return ”; // Get station $station_url =…Continue reading
/** * WPCode snippet: Redirect old post URLs https://domain.com/ * to new URLs https://domain.com/stories/ (301) * * – Multisite-safe (runs per-site) * – Only redirects if the old top-level path is a real *post* slug * – Does NOT affect…Continue reading