WC_Admin_Post_Types::__construct
Constructor.
Метод класса: WC_Admin_Post_Types{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Admin_Post_Types = new WC_Admin_Post_Types(); $WC_Admin_Post_Types->__construct();
Код WC_Admin_Post_Types::__construct() WC Admin Post Types:: construct WC 10.3.4
public function __construct() {
include_once __DIR__ . '/class-wc-admin-meta-boxes.php';
if ( ! function_exists( 'duplicate_post_plugin_activation' ) ) {
include_once __DIR__ . '/class-wc-admin-duplicate-product.php';
}
// Load correct list table classes for current screen.
add_action( 'current_screen', array( $this, 'setup_screen' ) );
add_action( 'check_ajax_referer', array( $this, 'setup_screen' ) );
// Admin notices.
add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
add_filter( 'woocommerce_order_updated_messages', array( $this, 'order_updated_messages' ) );
add_filter( 'bulk_post_updated_messages', array( $this, 'bulk_post_updated_messages' ), 10, 2 );
add_action(
'admin_notices',
function () {
$this->maybe_display_warning_for_password_protected_coupon();
}
);
// Disable Auto Save.
add_action( 'admin_print_scripts', array( $this, 'disable_autosave' ) );
// Extra post data and screen elements.
add_action( 'edit_form_top', array( $this, 'edit_form_top' ) );
add_filter( 'enter_title_here', array( $this, 'enter_title_here' ), 1, 2 );
add_action( 'edit_form_after_title', array( $this, 'edit_form_after_title' ) );
add_filter( 'default_hidden_meta_boxes', array( $this, 'hidden_meta_boxes' ), 10, 2 );
add_action( 'post_submitbox_misc_actions', array( $this, 'product_data_visibility' ) );
include_once __DIR__ . '/class-wc-admin-upload-downloadable-product.php';
// Hide template for CPT archive.
add_filter( 'theme_page_templates', array( $this, 'hide_cpt_archive_templates' ), 10, 3 );
add_action( 'edit_form_top', array( $this, 'show_cpt_archive_notice' ) );
// Add a post display state for special WC pages.
add_filter( 'display_post_states', array( $this, 'add_display_post_states' ), 10, 2 );
// Bulk / quick edit.
add_action( 'bulk_edit_custom_box', array( $this, 'bulk_edit' ), 10, 2 );
add_action( 'quick_edit_custom_box', array( $this, 'quick_edit' ), 10, 2 );
add_action( 'save_post', array( $this, 'bulk_and_quick_edit_hook' ), 10, 2 );
add_action( 'woocommerce_product_bulk_and_quick_edit', array( $this, 'bulk_and_quick_edit_save_post' ), 10, 2 );
}