exclude meta key from duplicating products
add_filter( ‘woocommerce_duplicate_product_exclude_meta’, function( $meta_to_exclude ) { $meta_to_exclude[] = ‘meta_key_to_exclude’; return $meta_to_exclude; } );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘woocommerce_duplicate_product_exclude_meta’, function( $meta_to_exclude ) { $meta_to_exclude[] = ‘meta_key_to_exclude’; return $meta_to_exclude; } );Continue reading
add_action( ‘init’, function() { if ( ! class_exists( ‘\EDD\Emails\Types\Email’ ) ) { return; } /** * The PreApproved email class. * * This is sent to customers as their ‘preapproved payment confirmation’. */ class EDDWP_PreApproved_Email extends \EDD\Emails\Types\Email { /** *…Continue reading
// Quick and easy way to insert taxonomy terms // We can quickly insert the terms and let WordPress do it under the hood by default however it knows best. // Here is a simple example: // $terms = […Continue reading
// Quick and easy way to insert taxonomy terms // We can quickly insert the terms and let WordPress do it under the hood by default however it knows best. // Here is a simple example: // $terms = […Continue reading
// WP Docs: https://developer.wordpress.org/reference/functions/register_post_type/#parameters // Reference: https://zerowp.com/modify-cpt-arguments-after-it-was-registered/ // Example below: add_action(‘register_post_type_args’, function ($args, $postType) { if ($postType !== ‘book’){ return $args; } $args[‘show_in_rest’] = true; $args[‘public’] = true; return $args; }, 99, 2);Continue reading
// WP Docs: https://developer.wordpress.org/reference/functions/register_post_type/#parameters // Reference: https://zerowp.com/modify-cpt-arguments-after-it-was-registered/ // Example below: add_action(‘register_post_type_args’, function ($args, $postType) { if ($postType !== ‘book’){ return $args; } $args[‘show_in_rest’] = true; $args[‘public’] = true; return $args; }, 99, 2);Continue reading
// function grid_query_related_posts( $query_args, $grid_id ) { // global $post; // if ( 155 !== $grid_id ) { // return $query_args; // } // $taxonomy = ‘vendor-category’; // $post_id = wp_doing_ajax() ? url_to_postid( wp_get_referer() ) : $post->ID; // $terms =…Continue reading
add_filter( ‘eawp_excerpt’, function($content) { return the_content(); }, 10,1);Continue reading
add_filter( ‘wfea_api_results’, // hook to filter returned event data before display /** * @param $events * @param $atts * * @return mixed * @throws Exception */ function ( $events, $atts ) { if ( ! in_array( $atts[‘layout’], array( ‘cal_list’, ‘cal’…Continue reading