No Description

class-wc-twenty-ten.php 1.3KB

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