<commit_before><?php
/**
 * Created by PhpStorm.
 * User: yujinyan
 * Date: 2015/9/17
 * Time: 23:46
 */


/**
 * enqueue stylesheets
 */

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    $parent_style = 'parent-style';

 wp_enqueue_script('bootstrapjs',get_stylesheet_directory_uri().'/js/bootstrap.min.js');
    /*wp_enqueue_style('bootstrap',get_stylesheet_directory_uri().'/css/bootstrap.min.css');*/

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style )
    );

}


/**
 * modify markups for header
 */

add_action('init','jo_remove_storefront_header_search');
add_action('init','jo_remove_storefront_header_cart');
add_action('init','jo_remove_storefront_primary_navigation');
add_action( 'storefront_header', 'storefront_primary_navigation',		15 );

//add_action( 'widgets_init', 'jo_remove_fourteen_sidebars', 11 );

function jo_remove_storefront_header_search(){
    remove_action('storefront_header','storefront_product_search',40);
}
function jo_remove_storefront_header_cart(){
    remove_action('storefront_header','storefront_header_cart',60);
}
function jo_remove_storefront_primary_navigation(){
    remove_action('storefront_header','storefront_primary_navigation',50);
}

function jo_remove_fourteen_sidebars() {
    unregister_sidebar( 'sidebar-1' ); // primary on left
    unregister_sidebar( 'sidebar-2' ); // secondary on right
}




/**
 * modify nav based on whether user logged in or not
*/

add_filter( 'wp_nav_menu_args', 'jo_nav_menu_args' );

function jo_nav_menu_args( $args) {

    if( is_user_logged_in() ) {
        if('primary'==$args['theme_location']){
            $args['menu'] = 'Main Nav Logged In';
        }
    }
    return $args;
}

/**
 * modify wooCommerce product page
*/

//remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
//add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

function woocommerce_template_product_description() {
    wc_get_template( 'single-product/tabs/additional-information.php' );
    wc_get_template( 'single-product/tabs/description.php' );



}



add_action('woocommerce_after_single_product_summary', create_function( '$args', 'call_user_func(\'comments_template\');'), 14);

/**
 * Change text strings<commit_msg>fix handheld menu display the correct handheld menu items for logged-in users<commit_after><?php
/**
 * Created by PhpStorm.
 * User: yujinyan
 * Date: 2015/9/17
 * Time: 23:46
 */


/**
 * enqueue stylesheets
 */

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    $parent_style = 'parent-style';

 wp_enqueue_script('bootstrapjs',get_stylesheet_directory_uri().'/js/bootstrap.min.js');
    /*wp_enqueue_style('bootstrap',get_stylesheet_directory_uri().'/css/bootstrap.min.css');*/

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style )
    );

}


/**
 * modify markups for header
 */

add_action('init','jo_remove_storefront_header_search');
add_action('init','jo_remove_storefront_header_cart');
add_action('init','jo_remove_storefront_primary_navigation');
add_action( 'storefront_header', 'storefront_primary_navigation',		15 );

//add_action( 'widgets_init', 'jo_remove_fourteen_sidebars', 11 );

function jo_remove_storefront_header_search(){
    remove_action('storefront_header','storefront_product_search',40);
}
function jo_remove_storefront_header_cart(){
    remove_action('storefront_header','storefront_header_cart',60);
}
function jo_remove_storefront_primary_navigation(){
    remove_action('storefront_header','storefront_primary_navigation',50);
}

function jo_remove_fourteen_sidebars() {
    unregister_sidebar( 'sidebar-1' ); // primary on left
    unregister_sidebar( 'sidebar-2' ); // secondary on right
}




/**
 * modify nav based on whether user logged in or not
*/

add_filter( 'wp_nav_menu_args', 'jo_nav_menu_args' );

function jo_nav_menu_args( $args) {

    if( is_user_logged_in() ) {
        if($args['theme_location']=='primary'||$args['theme_location']=='handheld'){
            $args['menu'] = 'Main Nav Logged In';
        }
    }
    return $args;
}

/**
 * modify wooCommerce product page
*/

//remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
//add_action( 'woocommerce_single_product_summary', 'woocommerce_template_product_description', 20 );

function woocommerce_template_product_description() {
    wc_get_template( 'single-product/tabs/additional-information.php' );
    wc_get_template( 'single-product/tabs/description.php' );



}



add_action('woocommerce_after_single_product_summary', create_function( '$args', 'call_user_func(\'comments_template\');'), 14);

/**
 * Change text strings
{'fraction_non_alphanumeric': 0.1378224059854302, 'fraction_numerical': 0.011419570781649931, 'mean_word_length': 5.78237650200267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2073664', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1638, 'n_words': 248}