/** * WPCode Snippet: GravityView Views ACF Fields * Description: Registers ACF fields for GravityView configurations and settings * Location: Run Everywhere * Priority: 10 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘acf/init’, function() { if ( ! function_exists( ‘acf_add_local_field_group’…Continue reading
/** * WPCode Snippet: GravityView Views CPT Registration * Description: Registers custom post type for GravityView with full REST API support * Location: Run Everywhere * Priority: 0 */ defined( ‘ABSPATH’ ) || exit; add_action( ‘init’, function() { $labels =…Continue reading
function shortcode_merken_logos() { // Probeer eerst ‘pa_brand’ $terms = get_terms(array( ‘taxonomy’ => ‘pa_brand’, ‘hide_empty’ => false, )); // Als ‘pa_brand’ leeg is of niet bestaat, gebruik ‘pa_merk’ if (empty($terms) || is_wp_error($terms)) { $terms = get_terms(array( ‘taxonomy’ => ‘pa_merk’, ‘hide_empty’ =>…Continue reading
// Forceer aangepaste vertalingen met ondersteuning voor NL / EN / DE function translated_text_strings( $translated_text, $text, $domain ) { // Haal de huidige site-taal op (bv. ‘nl_NL’, ‘en_US’, ‘de_DE’) $locale = get_locale(); switch ( $translated_text ) { // Algemene WooCommerce…Continue reading
// This snippet ONLY runs on MOBILE devices. // It checks if the user is on a desktop page and sends them to the mobile version. add_action( ‘template_redirect’, function() { // — Define your page pairs — // ‘desktop_page_slug’ =>…Continue reading
// ACF Options page add_action(‘acf/init’, function() { if ( function_exists(‘acf_add_options_page’) ) { acf_add_options_page(array( ‘page_title’ => ‘Winkelinstellingen’, ‘menu_title’ => ‘Winkelinstellingen’, ‘menu_slug’ => ‘instellingen’, ‘capability’ => ‘edit_posts’, ‘redirect’ => true, )); } }); // ACF read only fields function wwk_acf_read_only_field( $field )…Continue reading
// Verberg availability/stock tekst voor variaties met ‘Toestaan, maar klant informeren’ add_filter( ‘woocommerce_get_availability_text’, function( $availability, $product ) { if ( $product && $product->is_type(‘variation’) ) { // toon geen availability tekst als backorders toegestaan zijn mét notificatie en het item op…Continue reading
function mycode_hide_attributes_from_additional_info_tabs( $attributes, $product ) { /** * Array of attributes to hide from the Additional Information * tab on single WooCommerce product pages. */ $hidden_attributes = [ ‘pa_kleur’, ‘pa_maat’, ‘pa_lengtemaat’, ‘pa_filter-color’, ‘pa_taillemaat’, ‘pa_merk’ ]; foreach ( $hidden_attributes as $hidden_attribute…Continue reading
add_action( ‘wp_body_open’, ‘toon_winkelmededeling_banner’ ); function toon_winkelmededeling_banner() { $tekst = get_field( ‘winkelmededeling_tekst’, ‘option’ ); $link = get_field( ‘winkelmededeling_link’, ‘option’ ); $start_datum = get_field( ‘winkelmededeling_start’, ‘option’ ); $start_tijd = get_field( ‘winkelmededeling_starttijd’, ‘option’ ); $eind_datum = get_field( ‘winkelmededeling_einde’, ‘option’ ); $eind_tijd = get_field(…Continue reading
// ============================================================================ // Gravity Forms: vul keuzelijst met producten en selecteer huidig product // Filters: gform_pre_render/admin_pre_render/pre_validation/pre_submission_filter // ============================================================================ add_filter( ‘gform_pre_render’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_admin_pre_render’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_pre_validation’, ‘populate_product_select_with_selected’ ); add_filter( ‘gform_pre_submission_filter’, ‘populate_product_select_with_selected’ ); function populate_product_select_with_selected( $form ) { if(…Continue reading