block-editor-settings.php
4 years ago
sidebar.php
1 year ago
templates-filters.php
1 year ago
utils.php
2 years ago
woocommerce-basic.php
2 years ago
utils.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | use Kubio\Flags; |
| 4 | |
| 5 | function kubio_has_kubio_woocommerce_support() { |
| 6 | $has_support = current_theme_supports( 'kubio-woocommerce' ); |
| 7 | |
| 8 | if ( Flags::get( 'kubio_installed_via_fresh_site', false ) ) { |
| 9 | $has_support = true; |
| 10 | } |
| 11 | |
| 12 | return apply_filters( 'kubio/woocommerce/has-kubio-specific-support', $has_support ); |
| 13 | } |
| 14 | |
| 15 | |
| 16 | function kubio_get_woocommerce_content() { |
| 17 | |
| 18 | if ( is_single() ) { |
| 19 | |
| 20 | return WC_Shortcodes::product_page( |
| 21 | array( |
| 22 | 'id' => get_the_ID(), |
| 23 | 'show_title' => 0, |
| 24 | ) |
| 25 | ); |
| 26 | } |
| 27 | |
| 28 | ob_start(); |
| 29 | add_filter( 'woocommerce_show_page_title', '__return_false' ); |
| 30 | woocommerce_content(); |
| 31 | |
| 32 | return ob_get_clean(); |
| 33 | } |
| 34 |