Нема описа

class-wc-twenty-twelve.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Twenty Twelve support.
  4. *
  5. * @class WC_Twenty_Twelve
  6. * @since 3.3.0
  7. * @package WooCommerce\Classes
  8. */
  9. defined( 'ABSPATH' ) || exit;
  10. /**
  11. * WC_Twenty_Twelve class.
  12. */
  13. class WC_Twenty_Twelve {
  14. /**
  15. * Theme init.
  16. */
  17. public static function init() {
  18. // Remove default wrappers.
  19. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper' );
  20. remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end' );
  21. // Add custom wrappers.
  22. add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ) );
  23. add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ) );
  24. // Declare theme support for features.
  25. add_theme_support( 'wc-product-gallery-zoom' );
  26. add_theme_support( 'wc-product-gallery-lightbox' );
  27. add_theme_support( 'wc-product-gallery-slider' );
  28. add_theme_support(
  29. 'woocommerce',
  30. array(
  31. 'thumbnail_image_width' => 200,
  32. 'single_image_width' => 300,
  33. )
  34. );
  35. }
  36. /**
  37. * Open wrappers.
  38. */
  39. public static function output_content_wrapper() {
  40. echo '<div id="primary" class="site-content"><div id="content" role="main" class="twentytwelve">';
  41. }
  42. /**
  43. * Close wrappers.
  44. */
  45. public static function output_content_wrapper_end() {
  46. echo '</div></div>';
  47. }
  48. }
  49. WC_Twenty_Twelve::init();