Merge pull request #17604 from woocommerce/improve/17549
Underscores wrappers
This commit is contained in:
commit
ffa6637391
|
@ -2728,3 +2728,13 @@ function wc_page_noindex() {
|
|||
}
|
||||
}
|
||||
add_action( 'wp_head', 'wc_page_noindex' );
|
||||
|
||||
/**
|
||||
* Get a slug identifying the current theme.
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @return string
|
||||
*/
|
||||
function wc_get_theme_slug_for_templates() {
|
||||
return apply_filters( 'woocommerce_theme_slug_for_templates', get_option( 'template' ) );
|
||||
}
|
||||
|
|
|
@ -13,16 +13,19 @@
|
|||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 1.6.4
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
$template = get_option( 'template' );
|
||||
$template = wc_get_theme_slug_for_templates();
|
||||
|
||||
switch ( $template ) {
|
||||
case 'twentyten' :
|
||||
echo '</div></div>';
|
||||
break;
|
||||
case 'twentyeleven' :
|
||||
echo '</div>';
|
||||
get_sidebar( 'shop' );
|
||||
|
@ -45,6 +48,6 @@ switch ( $template ) {
|
|||
echo '</main></div>';
|
||||
break;
|
||||
default :
|
||||
echo '</div></div>';
|
||||
echo '</div></main>';
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -13,16 +13,19 @@
|
|||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 1.6.4
|
||||
* @version 3.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
$template = get_option( 'template' );
|
||||
$template = wc_get_theme_slug_for_templates();
|
||||
|
||||
switch ( $template ) {
|
||||
case 'twentyten' :
|
||||
echo '<div id="container"><div id="content" role="main">';
|
||||
break;
|
||||
case 'twentyeleven' :
|
||||
echo '<div id="primary"><div id="content" role="main" class="twentyeleven">';
|
||||
break;
|
||||
|
@ -42,6 +45,6 @@ switch ( $template ) {
|
|||
echo '<div id="primary" class="content-area twentysixteen"><main id="main" class="site-main" role="main">';
|
||||
break;
|
||||
default :
|
||||
echo '<div id="container"><div id="content" role="main">';
|
||||
echo '<div id="primary" class="content-area"><main id="main" class="site-main" role="main">';
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue