commit
f5ff10711d
|
@ -2,14 +2,15 @@
|
|||
/**
|
||||
* Adds settings to the permalinks admin settings page.
|
||||
*
|
||||
* @class WC_Admin_Permalink_Settings
|
||||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 2.1.0
|
||||
* @version 2.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_Permalink_Settings' ) ) :
|
||||
|
@ -28,7 +29,7 @@ class WC_Admin_Permalink_Settings {
|
|||
}
|
||||
|
||||
/**
|
||||
* Init our settings
|
||||
* Init our settings.
|
||||
*/
|
||||
public function settings_init() {
|
||||
// Add a section to the permalinks page
|
||||
|
@ -89,7 +90,7 @@ class WC_Admin_Permalink_Settings {
|
|||
}
|
||||
|
||||
/**
|
||||
* Show the settings
|
||||
* Show the settings.
|
||||
*/
|
||||
public function settings() {
|
||||
echo wpautop( __( 'These settings control the permalinks used for products. These settings only apply when <strong>not using "default" permalinks above</strong>.', 'woocommerce' ) );
|
||||
|
@ -153,7 +154,7 @@ class WC_Admin_Permalink_Settings {
|
|||
}
|
||||
|
||||
/**
|
||||
* Save the settings
|
||||
* Save the settings.
|
||||
*/
|
||||
public function settings_save() {
|
||||
|
||||
|
|
|
@ -1,31 +1,32 @@
|
|||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Comments
|
||||
*
|
||||
* Handle comments (reviews and order notes)
|
||||
*
|
||||
* @class WC_Post_types
|
||||
* @class WC_Comments
|
||||
* @version 2.3.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class WC_Comments {
|
||||
|
||||
/**
|
||||
* Hook in methods
|
||||
* Hook in methods.
|
||||
*/
|
||||
public static function init() {
|
||||
|
||||
// Rating posts
|
||||
add_filter( 'preprocess_comment', array( __CLASS__, 'check_comment_rating' ), 0 );
|
||||
add_action( 'comment_post', array( __CLASS__, 'add_comment_rating' ), 1 );
|
||||
|
||||
// clear transients
|
||||
// Clear transients
|
||||
add_action( 'wp_update_comment_count', array( __CLASS__, 'clear_transients' ) );
|
||||
|
||||
// Secure order notes
|
||||
|
@ -41,7 +42,7 @@ class WC_Comments {
|
|||
// Count comments
|
||||
add_filter( 'wp_count_comments', array( __CLASS__, 'wp_count_comments' ), 10, 2 );
|
||||
|
||||
// support avatars for `review` comment type
|
||||
// Support avatars for `review` comment type
|
||||
add_filter( 'get_avatar_comment_types', array( __CLASS__, 'add_avatar_for_review_comment_type' ) );
|
||||
}
|
||||
|
||||
|
@ -53,7 +54,6 @@ class WC_Comments {
|
|||
* shop managers can view orders anyway.
|
||||
*
|
||||
* The frontend view order pages get around this filter by using remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );
|
||||
*
|
||||
* @param array $clauses
|
||||
* @return array
|
||||
*/
|
||||
|
@ -83,7 +83,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Exclude order comments from queries and RSS
|
||||
*
|
||||
* @param string $join
|
||||
* @return string
|
||||
*/
|
||||
|
@ -99,7 +98,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Exclude order comments from queries and RSS
|
||||
*
|
||||
* @param string $where
|
||||
* @return string
|
||||
*/
|
||||
|
@ -117,7 +115,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Exclude webhook comments from queries and RSS
|
||||
*
|
||||
* @since 2.2
|
||||
* @param array $clauses
|
||||
* @return array
|
||||
|
@ -144,7 +141,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Exclude webhook comments from queries and RSS
|
||||
*
|
||||
* @since 2.2
|
||||
* @param string $join
|
||||
* @return string
|
||||
|
@ -161,7 +157,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Exclude webhook comments from queries and RSS
|
||||
*
|
||||
* @since 2.1
|
||||
* @param string $where
|
||||
* @return string
|
||||
|
@ -180,7 +175,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Validate the comment ratings.
|
||||
*
|
||||
* @param array $comment_data
|
||||
* @return array
|
||||
*/
|
||||
|
@ -196,7 +190,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Rating field for comments.
|
||||
*
|
||||
* @param int $comment_id
|
||||
*/
|
||||
public static function add_comment_rating( $comment_id ) {
|
||||
|
@ -211,7 +204,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Clear transients for a review.
|
||||
*
|
||||
* @param int $post_id
|
||||
*/
|
||||
public static function clear_transients( $post_id ) {
|
||||
|
@ -229,7 +221,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Remove order notes from wp_count_comments()
|
||||
*
|
||||
* @since 2.2
|
||||
* @param object $stats
|
||||
* @param int $post_id
|
||||
|
@ -276,7 +267,6 @@ class WC_Comments {
|
|||
|
||||
/**
|
||||
* Make sure WP displays avatars for comments with the `review` type
|
||||
*
|
||||
* @since 2.3
|
||||
* @param array $comment_types
|
||||
* @return array
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle frontend scripts
|
||||
*
|
||||
|
@ -13,6 +8,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* WC_Frontend_Scripts Class
|
||||
*/
|
||||
class WC_Frontend_Scripts {
|
||||
|
||||
/**
|
||||
|
@ -28,7 +31,7 @@ class WC_Frontend_Scripts {
|
|||
private static $wp_localize_scripts = array();
|
||||
|
||||
/**
|
||||
* Hook in methods
|
||||
* Hook in methods.
|
||||
*/
|
||||
public static function init() {
|
||||
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'load_scripts' ) );
|
||||
|
@ -37,7 +40,7 @@ class WC_Frontend_Scripts {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get styles for the frontend
|
||||
* Get styles for the frontend.
|
||||
* @access private
|
||||
* @return array
|
||||
*/
|
||||
|
@ -65,7 +68,7 @@ class WC_Frontend_Scripts {
|
|||
}
|
||||
|
||||
/**
|
||||
* Register a script for use
|
||||
* Register a script for use.
|
||||
*
|
||||
* @uses wp_register_script()
|
||||
* @access private
|
||||
|
@ -81,7 +84,7 @@ class WC_Frontend_Scripts {
|
|||
}
|
||||
|
||||
/**
|
||||
* Register and enqueue a script for use
|
||||
* Register and enqueue a script for use.
|
||||
*
|
||||
* @uses wp_enqueue_script()
|
||||
* @access private
|
||||
|
@ -100,8 +103,6 @@ class WC_Frontend_Scripts {
|
|||
|
||||
/**
|
||||
* Register/queue frontend scripts.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public static function load_scripts() {
|
||||
global $post;
|
||||
|
@ -196,7 +197,7 @@ class WC_Frontend_Scripts {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return data for script handles
|
||||
* Return data for script handles.
|
||||
* @access private
|
||||
* @param string $handle
|
||||
* @return array|bool
|
||||
|
|
|
@ -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
|
||||
* @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' ) ) {
|
||||
|
@ -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,7 +469,7 @@ class WC_Post_types {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add Product Support to Jetpack Omnisearch
|
||||
* Add Product Support to Jetpack Omnisearch.
|
||||
*/
|
||||
public static function support_jetpack_omnisearch() {
|
||||
if ( class_exists( 'Jetpack_Omnisearch_Posts' ) ) {
|
||||
|
|
|
@ -21,15 +21,15 @@ class WC_Unit_Test_Case extends WP_UnitTestCase {
|
|||
|
||||
parent::setUp();
|
||||
|
||||
// add custom factories
|
||||
// Add custom factories
|
||||
$this->factory = new WC_Unit_Test_Factory();
|
||||
|
||||
// setup mock WC session handler
|
||||
// Setup mock WC session handler
|
||||
add_filter( 'woocommerce_session_handler', array( $this, 'set_mock_session_handler' ) );
|
||||
|
||||
$this->setOutputCallback( array( $this, 'filter_output' ) );
|
||||
|
||||
// register post types before each test
|
||||
// Register post types before each test
|
||||
WC_Post_types::register_post_types();
|
||||
WC_Post_types::register_taxonomies();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ class WC_Unit_Test_Case extends WP_UnitTestCase {
|
|||
/**
|
||||
* Asserts thing is WP_Error
|
||||
*
|
||||
* @param $actual
|
||||
* @param mixed $actual
|
||||
* @param string $message
|
||||
*/
|
||||
public function assertIsWPError( $actual, $message = '' ) {
|
||||
|
|
Loading…
Reference in New Issue