This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Insert text below the Featured Products title | |
| function add_featured_text_example() { | |
| // Echo out content | |
| echo '<p>' . esc_html__( 'These are definitely our best products to consider!', 'storefront' ) . '</p>'; | |
| } | |
| add_action( 'storefront_homepage_after_featured_products_title' , 'add_featured_text_example' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function sensei_display_start_course_form_when_admin_or_teacher( $should_display_start, $course_id ) { | |
| global $current_user; | |
| if ( empty( $current_user ) ) { | |
| $current_user = wp_get_current_user(); | |
| } | |
| if ( !( $current_user instanceof WP_User ) || 0 === $current_user->ID ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- Template Name: Unique name of your choosing --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('woocommerce_dynamic_pricing_process_product_discounts', 'exclude_some_products', 10, 4); | |
| function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) { | |
| if ($product->ID == 200){ | |
| $eligible = false; | |
| } | |
| return $eligible; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'sensei_single_title', 'sensei_dl_custom_double_quiz_remove' ); | |
| function sensei_dl_custom_double_quiz_remove( $title ){ | |
| if( 'quiz' == get_post_type() | |
| && 1 < substr_count( strtoupper( $title ), 'QUIZ' ) ){ | |
| // remove all possible appearances of quiz | |
| $title_with_no_quizzes = str_replace( 'quiz', '', $title ); | |
| $title_with_no_quizzes = str_replace( 'Quiz', '', $title_with_no_quizzes ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_shipping_australia_post_tax_rate' , 'woocommerce_shipping_australia_post_custom_tax_rate' ); | |
| /** | |
| * Adjust tax rate | |
| * | |
| * @access public | |
| * @since 1.0 | |
| * @return void | |
| */ | |
| function woocommerce_shipping_australia_post_custom_tax_rate() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'wc_nf_addons_cart_option', 'wc_ninja_forms_price' ); | |
| function wc_ninja_forms_price( $display ) { | |
| return ''; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'wc_nf_addons_format_cart_item_price' , 'wc_ninja_forms_hide_zero_price' ); | |
| function wc_ninja_forms_hide_zero_price( $value ) { | |
| $hide_price = ' (' . wc_price( '0.00' ) . ')'; | |
| if ( $value == $hide_price ) { | |
| return ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function wcsdp_only_allow_paypal_for_subscriptions( $available_gateways ) { | |
| global $wp; | |
| if ( class_exists( 'WC_Subscriptions_Cart' ) ) { | |
| if ( WC_Subscriptions_Cart::cart_contains_subscription() || WC_Subscriptions_Cart::cart_contains_subscription_renewal() || ( is_checkout_pay_page() && WC_Subscriptions_Order::order_contains_subscription( $wp->query_vars['order-pay'] ) ) ) { | |
| if ( isset( $available_gateways['paypal'] ) ) { | |
| return array( 'paypal' => $available_gateways['paypal'] ); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp', 'custom_hidden_comments' ); | |
| function custom_hidden_comments() { | |
| if ( ! is_admin() ) { | |
| $restrictions = wc_memberships()->restrictions; | |
| remove_filter( 'wp', array( $restrictions, 'hide_restricted_content_comments' ) ); | |
| } | |
| } | |
| add_filter( 'wp', 'custom_hide_restricted_content_comments' ); | |
| function custom_hide_restricted_content_comments( $content ) { |