add_filter( ‘body_class’, function( $classes ) { $acc_type=tmwp_get_user_role(); if (!$acc_type) $acc_type=’anonymous’; return array_merge( $classes, array(‘acc-type-‘.strtolower($acc_type),tmwp_get_page_class()) ); } );Continue reading
add_action( ‘init’, ‘custom_logout’ ); function custom_logout() { if ( strpos($_SERVER[‘REQUEST_URI’], ‘/customer-logout’) !== false ) { wp_logout(); $redirect_url = home_url(); wp_safe_redirect($redirect_url); exit; } }Continue reading
/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading
add_filter( ‘acf/shortcode/allow_unsafe_html’, function ( $allowed, $atts ) { $allowed = true; return $allowed; }, 10, 2 ); add_filter( ‘acf/the_field/allow_unsafe_html’, function( $allowed, $selector ) { $allowed = true; return $allowed; }, 10, 2 );Continue reading
// This code snippet provides dynamic data to a // In use for Elementor Templates // – Active Templates: Vendor Taxonomy Archive // – Vendor Taxonomies: Vendor Location, Vendor Zone, Vendor Pricing, Vendor Identity Attributes, Vendor Categories // Reference URL…Continue reading
// This code snippet ensures that vendors are displayed in the following order: // – Featured vendors (vendor posts with ‘status_ven_featured’ set to 1) in ascending order by post title // – Love list vendors (vendor posts with ‘status_ven_love_list’ set…Continue reading
// This code snippet ensures that vendors are displayed in the following order: // – Featured vendors (vendor posts with ‘status_ven_featured’ set to 1) in ascending order by post title // – Love list vendors (vendor posts with ‘status_ven_love_list’ set…Continue reading