Support » Fixing WordPress » Is it possible to execute filter for all products except a few?

  • Hello all,

    A question: Is it possible to execute filter for all products except a few?

    I use this on my website

    <?php
    add_filter( 'woocommerce_bundled_item_is_optional_checked', 'wc_pb_is_optional_item_checked', 10, 2 );
    function wc_pb_is_optional_item_checked( $checked, $bundled_item ) {
    	if ( ! isset( $_GET[ 'update-bundle' ] ) ) {
    		$checked = true;
    	}
    	return $checked;
    }

    Some products need to have unchecked bundle products. Can I add for example page id’s to this code to exclude them from being executed?

    Thanks in advance,

    Tom

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Is it possible to execute filter for all products except a few?’ is closed to new replies.