Docblocks cleanup for WC_Post_types

This commit is contained in:
shivapoudel 2015-02-04 21:59:14 +05:45
parent fa6a99bd1d
commit d6b44d9369
1 changed files with 35 additions and 32 deletions

View File

@ -1,24 +1,27 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Post types
* Post Types
*
* Registers post types and taxonomies
*
* @class WC_Post_types
* @version 2.2.0
* @package WooCommerce/Classes/Products
* @category Class
* @author WooThemes
* @class WC_Post_types
* @version 2.3.0
* @package WooCommerce/Classes/Products
* @category Class
* @author WooThemes
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* WC_Post_types Class
*/
class WC_Post_types {
/**
* Hook in methods
* Hook in methods.
*/
public static function init() {
add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 5 );
@ -28,7 +31,7 @@ class WC_Post_types {
}
/**
* Register WooCommerce taxonomies.
* Register core taxonomies.
*/
public static function register_taxonomies() {
if ( taxonomy_exists( 'product_type' ) ) {
@ -40,16 +43,16 @@ class WC_Post_types {
$permalinks = get_option( 'woocommerce_permalinks' );
register_taxonomy( 'product_type',
apply_filters( 'woocommerce_taxonomy_objects_product_type', array( 'product' ) ),
apply_filters( 'woocommerce_taxonomy_args_product_type', array(
'hierarchical' => false,
'show_ui' => false,
'show_in_nav_menus' => false,
'query_var' => is_admin(),
'rewrite' => false,
'public' => false
) )
);
apply_filters( 'woocommerce_taxonomy_objects_product_type', array( 'product' ) ),
apply_filters( 'woocommerce_taxonomy_args_product_type', array(
'hierarchical' => false,
'show_ui' => false,
'show_in_nav_menus' => false,
'query_var' => is_admin(),
'rewrite' => false,
'public' => false
) )
);
register_taxonomy( 'product_cat',
apply_filters( 'woocommerce_taxonomy_objects_product_cat', array( 'product' ) ),
@ -210,7 +213,7 @@ class WC_Post_types {
}
/**
* Register core post types
* Register core post types.
*/
public static function register_post_types() {
if ( post_type_exists('product') ) {
@ -404,7 +407,7 @@ class WC_Post_types {
}
/**
* Register our custom post statuses, used for order status
* Register our custom post statuses, used for order status.
*/
public static function register_post_status() {
register_post_status( 'wc-pending', array(
@ -466,13 +469,13 @@ class WC_Post_types {
}
/**
* Add Product Support to Jetpack Omnisearch
*/
public static function support_jetpack_omnisearch() {
if ( class_exists( 'Jetpack_Omnisearch_Posts' ) ) {
new Jetpack_Omnisearch_Posts( 'product' );
}
}
* Add Product Support to Jetpack Omnisearch.
*/
public static function support_jetpack_omnisearch() {
if ( class_exists( 'Jetpack_Omnisearch_Posts' ) ) {
new Jetpack_Omnisearch_Posts( 'product' );
}
}
}
WC_Post_types::init();