Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wpas_cf_taxonomy_oredered_terms', 'wpas_limit_products_on_submission' );
- /**
- * Remove products from the front-end dropdown on ticket submission
- *
- * In order the filter out products, simply add the product slug in the array within the foreach. If you want to filter
- * terms by something else than the slug, simply replace:
- * $product->slug
- * by what you need to use (eg. name, term_is, etc).
- *
- * @param array $products Array of term objects
- *
- * @return array
- */
- function wpas_limit_products_on_submission( $products ) {
- foreach ( $products as $key => $product ) {
- if ( in_array( $product->slug, array( 'my-product-slug' ) ) ) {
- unset( $products[ $key ] );
- }
- }
- return $products;
- }
Advertisement
Add Comment
Please, Sign In to add comment