/** * 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
/** * Membership Details Table Override * * Child Theme: Storefront-Child-Theme * WC Vendors Membership Template * * Hides certain rows for free plans while keeping table formatting. */ if ( ! defined( ‘ABSPATH’ ) ) { exit; // Exit…Continue reading
public function process_split_payment( $order ) { $vendors_due = WCV_Vendors::get_vendor_dues_from_order( $order, false ); $sub_accounts = array(); foreach ( $vendors_due as $vendor_id => $products ) { $_vendor_account = get_user_meta( $vendor_id, ‘_paystack_sub_account_code’, true ); $sub_accounts[] = array( ‘subaccount’ => $_vendor_account, ‘share’ => $calculated_share,…Continue reading
add_filter( ‘wp_revisions_to_keep’, function( $num, $post ) { return 10; }, 10, 2 );Continue reading
function wpo_ips_semaphore_lock_cleanup_interval() { return 7 * DAY_IN_SECONDS; // Modify the interval here. } add_filter( ‘wpo_ips_semaphore_lock_cleanup_interval’, ‘wpo_ips_semaphore_lock_cleanup_interval’ );Continue reading