WC_Admin::__construct
Constructor.
Method of the class: WC_Admin{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Admin = new WC_Admin(); $WC_Admin->__construct();
WC_Admin::__construct() WC Admin:: construct code WC 10.3.6
public function __construct() {
add_action( 'init', array( $this, 'includes' ) );
// Hook in early (priority 1) to make sure the PageController's hooks are added before any WC admin pages or
// menus logic is run, including the enqueuing of assets via \Automattic\WooCommerce\Internal\Admin\WCAdminAssets.
// While it may not sound like it, the admin_menu action is triggered quite early,
// before the admin_init or admin_enqueue_scripts action.
// @see https://developer.wordpress.org/apis/hooks/action-reference/#actions-run-during-an-admin-page-request.
add_action( 'admin_menu', array( $this, 'init_page_controller' ), 1 );
add_action( 'current_screen', array( $this, 'conditional_includes' ) );
add_action( 'admin_init', array( $this, 'buffer' ), 1 );
add_action( 'admin_init', array( $this, 'preview_emails' ) );
add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
add_action( 'admin_init', array( $this, 'admin_redirects' ) );
add_action( 'admin_footer', 'wc_print_js', 25 );
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 1 );
add_filter( 'update_footer', array( $this, 'update_footer_version' ), 20 );
// Disable WXR export of schedule action posts.
add_filter( 'action_scheduler_post_type_args', array( $this, 'disable_webhook_post_export' ) );
// Add body class for WP 5.3+ compatibility.
add_filter( 'admin_body_class', array( $this, 'include_admin_body_class' ), 9999 );
// Add body class for Marketplace and My Subscriptions pages.
if ( isset( $_GET['page'] ) && 'wc-addons' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
add_filter( 'admin_body_class', array( 'WC_Admin_Addons', 'filter_admin_body_classes' ) );
}
}