Make methods static

This commit is contained in:
Mike Jolley 2017-02-24 12:41:15 +00:00
parent eca9828d66
commit 1aaefd9ed7
1 changed files with 9 additions and 9 deletions

View File

@ -14,15 +14,15 @@ if ( ! defined( 'ABSPATH' ) ) {
class WC_Twenty_Seventeen {
/**
* Constructor.
* Theme init.
*/
public function __construct() {
public function init() {
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
add_action( 'woocommerce_before_main_content', array( $this, 'output_content_wrapper' ), 10 );
add_action( 'woocommerce_after_main_content', array( $this, 'output_content_wrapper_end' ), 10 );
add_filter( 'woocommerce_enqueue_styles', array( $this, 'enqueue_styles' ) );
add_action( 'woocommerce_before_main_content', array( __CLASS__, 'output_content_wrapper' ), 10 );
add_action( 'woocommerce_after_main_content', array( __CLASS__, 'output_content_wrapper_end' ), 10 );
add_filter( 'woocommerce_enqueue_styles', array( __CLASS__, 'enqueue_styles' ) );
}
/**
@ -31,7 +31,7 @@ class WC_Twenty_Seventeen {
* @param array $styles
* @return array
*/
public function enqueue_styles( $styles ) {
public static function enqueue_styles( $styles ) {
unset( $styles['woocommerce-general'] );
$styles['woocommerce-twenty-seventeen'] = array(
@ -47,7 +47,7 @@ class WC_Twenty_Seventeen {
/**
* Open the Twenty Seventeen wrapper.
*/
public function output_content_wrapper() { ?>
public static function output_content_wrapper() { ?>
<div class="wrap">
<div id="primary" class="content-area twentyseventeen">
<main id="main" class="site-main" role="main">
@ -57,7 +57,7 @@ class WC_Twenty_Seventeen {
/**
* Close the Twenty Seventeen wrapper.
*/
public function output_content_wrapper_end() { ?>
public static function output_content_wrapper_end() { ?>
</main>
</div>
<?php get_sidebar(); ?>
@ -66,4 +66,4 @@ class WC_Twenty_Seventeen {
}
}
new WC_Twenty_Seventeen();
WC_Twenty_Seventeen::init();