Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Child-Theme functions and definitions
- */
- function register_my_menus(){
- register_nav_menus
- (
- array('lang-menu' => 'lang-menu1')
- );
- }
- if(function_exists('register_nav_menus')){
- add_action('init','register_my_menus');
- }
- /*
- add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
- function woo_remove_product_tabs( $tabs ) {
- unset( $tabs['reviews'] ); // Удаление вкладки с отзывами
- return $tabs;
- }*/
- /*
- add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
- function woo_rename_tabs( $tabs ) {
- $tabs['description']['title'] = __( 'PRODUCT' ); // Переименование вкладки с описанием товара
- $tabs['additional_information']['title'] = __( 'SPECIFICATION' ); // Переименование с описанием товара
- return $tabs;
- }*/
- ?>
- <?php/*
- add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 );
- function woo_reorder_tabs( $tabs ) {
- $tabs['description']['priority'] = 10; // Описание вторая
- $tabs['additional_information']['priority'] = 15; // Дополнительная информация третья
- return $tabs;
- }*/
- /* add_filter( 'cmb_meta_boxes', 'bhww_core_cpt_metaboxes' ); */
- /* function bhww_core_cpt_metaboxes( $meta_boxes ) {
- //global $prefix;
- $prefix = '_bhww_'; // Prefix for all fields
- // Add metaboxes to the 'Product' CPT
- $meta_boxes[] = array(
- 'id' => 'bhww_woo_tabs_metabox',
- 'title' => 'Additional Product Information - <strong>Optional</strong>',
- 'pages' => array( 'product' ), // Which post type to associate with?
- 'context' => 'normal',
- 'priority' => 'default',
- 'show_names' => true,
- 'fields' => array(
- array(
- 'name' => __( 'Ingredients', 'cmb' ),
- 'desc' => __( 'Anything you enter here will be displayed on the Ingredients tab.', 'cmb' ),
- 'id' => $prefix . 'ingredients_wysiwyg',
- 'type' => 'wysiwyg',
- 'options' => array( 'textarea_rows' => 5, ),
- ),
- array(
- 'name' => __( 'Benefits', 'cmb' ),
- 'desc' => __( 'Anything you enter here will be displayed on the Benefits tab.', 'cmb' ),
- 'id' => $prefix . 'benefits_wysiwyg',
- 'type' => 'wysiwyg',
- 'options' => array( 'textarea_rows' => 5, ),
- ),
- ),
- );
- return $meta_boxes;
- } */
- add_filter( 'woocommerce_product_tabs', 'bhww_woo_extra_tabs' );
- function bhww_wooprint_r($post);_extra_tabs( $tabs ) {
- global $post;
- $product_ingredients = get_post_meta( $post->ID, '_bhww_ingredients_wysiwyg', true );
- $product_benefits = get_post_meta( $post->ID, '_bhww_benefits_wysiwyg', true );
- if ( ! empty( $product_ingredients ) ) {
- $tabs['ingredients_tab'] = array(
- 'title' => __( 'Ingredients', 'woocommerce' ),
- 'priority' => 15,
- 'callback' => 'bhww_woo_ingredients_tab_content'
- );
- }
- if ( ! empty( $product_benefits ) ) {
- $tabs['benefits_tab'] = array(
- 'title' => __( 'Benefits', 'woocommerce' ),
- 'priority' => 16,
- 'callback' => 'bhww_woo_benefits_tab_content'
- );
- }
- return $tabs;
- }
- function bhww_woo_ingreprint_r($post);dients_tab_content() {
- global $post;
- $product_ingredients = get_post_meta( $post->ID, '_bhww_ingredients_wysiwyg', true );
- if ( ! empty( $product_ingredients ) ) {
- echo '<h2>' . esc_html__( 'Product Ingredients', 'woocommerce' ) . '</h2>';
- // Updated to apply the_content filter to WYSIWYG content
- echo apply_filters( 'the_content', $product_ingredients );
- }
- }
- function bhww_woo_benefprint_r($post);its_tab_content() {
- global $post;
- $product_benefits = get_post_meta( $post->ID, '_bhww_benefits_wysiwyg', true );
- if ( ! empty( $product_benefits ) ) {
- echo '<h2>' . esc_html__( 'Product Benefits', 'woocommerce' ) . '</h2>';
- // Updated to apply the_content filter to WYSIWYG content
- echo apply_filters( 'the_content', $product_benefits );
- }
- }
- if ( ! empty( $product_ingredients ) ) {
- apply_filters( 'the_content', $product_ingredients );
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement