* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. */ function tripp_coupon_data( $post = 0 ) { /** * Coupons feature is included in the Tripp XT plugin. */ if ( ! function_exists( 'tripp_xt_get_coupons' ) ) { return; } if ( post_password_required( $post ) ) { return; } $post = get_post( $post ); if ( ! $post ) { return; } $coupons = tripp_xt_get_coupons( $post->ID ); if ( ! empty( $coupons ) ) { foreach ( $coupons as $coupon ) { get_template_part( 'template-parts/single/coupon', '', $coupon ); } } }