WC_Admin_Dashboard::__construct() public WC 1.0
Hook in tabs.
{} Это метод класса: WC_Admin_Dashboard{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$WC_Admin_Dashboard = new WC_Admin_Dashboard(); $WC_Admin_Dashboard->__construct();
Код WC_Admin_Dashboard::__construct() WC Admin Dashboard:: construct WC 5.0.0
public function __construct() {
// Only hook in admin parts if the user has admin access.
if ( current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'publish_shop_orders' ) ) {
// If on network admin, only load the widget that works in that context and skip the rest.
if ( is_multisite() && is_network_admin() ) {
add_action( 'wp_network_dashboard_setup', array( $this, 'register_network_order_widget' ) );
} else {
add_action( 'wp_dashboard_setup', array( $this, 'init' ) );
}
}
}