function fcbh_display_language_link() { global $wpdb; // Get the ACF field ‘rol’ from current post $post_id = get_the_ID(); $rol = get_field(‘rol’, $post_id); $language = get_field(‘lang’, $post_id); if (empty($rol)) { return ‘ No language code (ROL) found for this post. ‘; }…Continue reading
/** * People Groups Dynamic Field Loader * * Retrieves people group data from ArcGIS service (primary) or MySQL (fallback), * registers shortcodes for all fields, and syncs data to ACF fields. * * Features: * – Secure input handling…Continue reading
if ( class_exists( ‘WooCommerce’ ) ) { // Run after RD renaming snippet (in case enabled) add_filter( ‘gettext’, ‘rd_wc_coupon_text_overrides’, 30, 3 ); function rd_wc_coupon_text_overrides( $translated, $original, $domain ) { if ( is_admin() ) { return $translated; } if ( !…Continue reading
if ( class_exists( ‘WooCommerce’ ) ) { add_filter( ‘woocommerce_ship_to_different_address_checked’, function ( $checked ) { $checkout = WC()->checkout(); if ( ! $checkout ) { return $checked; } // Check if the shipping address has already been entered $shipping_first = $checkout->get_value( ‘shipping_first_name’…Continue reading
// Create Ajax handler // add_action(‘wp_ajax_get_fw_exp_date’, ‘get_fw_exp_date_callback’); function get_fw_exp_date_callback() { /* if (!is_user_logged_in()) { echo ‘Not logged in’; wp_die(); } */ $fw_user_id = get_current_user_id(); $get_fw_exp_date = get_user_meta($fw_user_id, ‘fw_exp_date’, true); if ($get_fw_exp_date) { // Convert YYYY-MM-DD to MM/DD/YYYY $date_obj = DateTime::createFromFormat(‘Y-m-d’,…Continue reading
/** * Name: fw_minimumAccountUsernameChars (“fw” indicates “FreeWheelers”) * Desc: Require the account username be at least 8 characters **/ add_filter(‘frm_validate_field_entry’, ‘fw_minimumAccountUsernameChars’, 10, 3); function fw_minimumAccountUsernameChars( $errors, $field, $posted_value ){ if ( $field->id == MEMBER_REGISTRATION_USER_NAME_FIELD_ID ) { $minimum = 8; if…Continue reading
// Show last modified date of a file function show_file_modified_date( $atts ) { $atts = shortcode_atts( array( ‘file’ => ”, // Example: ‘wp-content/uploads/data.json’ ‘format’ => ‘F j, Y g:i a’ // Optional date format ), $atts ); if ( empty(…Continue reading
/** Adds script to header ** Scroll to top of page – only on Pager facet interaction ** For more info see: ** https://facetwp.com/help-center/facets/facet-types/pager/#how-to-add-pagination-scrolling **/ add_action( ‘wp_head’, function() { ?>Continue reading
/** Adds script to header ** Scroll to top of page – only on Pager facet interaction ** For more info see: ** https://facetwp.com/help-center/facets/facet-types/pager/#how-to-add-pagination-scrolling **/ add_action( ‘wp_head’, function() { ?>Continue reading
add_filter( ‘rank_math/frontend/breadcrumb/items’, function( $crumbs, $class ) { //Adding to single products // change to match the post type name $value[] = array( ‘Shop’, // change to the actual name shown on the frontend ‘/shop/’, // change to the actual URL…Continue reading