name; $terms[] = $term->slug; $categories[] = (string) get_term_meta( $term->term_id, self::TERM_META, true ); } } } $type = TypeChoice::resolve( (string) get_post_meta( $product_id, self::PRODUCT_META, true ), $categories, $terms, Settings::enabled_types() ); /** * Filters the try-on type of a product: 'top', 'dress', 'eyewear', or null for none. * The owner's product and category settings are already applied. * * @since 1.0.0 * * @param string|null $type Type. * @param int $product_id Product ID. */ return ProductType::valid( apply_filters( 'fitzaro/product_type', $type, $product_id ) ); } /** * Labels of the choices offered in the product and category settings. * * @return array */ public static function choices(): array { return array( '' => __( 'Automatic', 'fitzaro' ), ProductType::TOP => __( 'Top', 'fitzaro' ), ProductType::DRESS => __( 'Dress', 'fitzaro' ), ProductType::EYEWEAR => __( 'Eyewear', 'fitzaro' ), TypeChoice::OFF => __( 'Off', 'fitzaro' ), ); } }