WooCommerce::init_hooks()
Hook into actions and filters.
Метод класса: WooCommerce{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->init_hooks();
Список изменений
С версии 2.3 | Введена. |
Код WooCommerce::init_hooks() WooCommerce::init hooks WC 9.4.2
private function init_hooks() { register_activation_hook( WC_PLUGIN_FILE, array( 'WC_Install', 'install' ) ); register_shutdown_function( array( $this, 'log_errors' ) ); add_action( 'plugins_loaded', array( $this, 'on_plugins_loaded' ), -1 ); add_action( 'plugins_loaded', array( $this, 'init_jetpack_connection_config' ), 1 ); add_action( 'admin_notices', array( $this, 'build_dependencies_notice' ) ); add_action( 'after_setup_theme', array( $this, 'setup_environment' ) ); add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 ); add_action( 'load-post.php', array( $this, 'includes' ) ); add_action( 'init', array( $this, 'init' ), 0 ); add_action( 'init', array( 'WC_Shortcodes', 'init' ) ); add_action( 'init', array( 'WC_Emails', 'init_transactional_emails' ) ); add_action( 'init', array( $this, 'add_image_sizes' ) ); add_action( 'init', array( $this, 'load_rest_api' ) ); if ( $this->is_request( 'admin' ) || ( $this->is_rest_api_request() && ! $this->is_store_api_request() ) || ( defined( 'WP_CLI' ) && WP_CLI ) ) { add_action( 'init', array( 'WC_Site_Tracking', 'init' ) ); } add_action( 'switch_blog', array( $this, 'wpdb_table_fix' ), 0 ); add_action( 'activated_plugin', array( $this, 'activated_plugin' ) ); add_action( 'deactivated_plugin', array( $this, 'deactivated_plugin' ) ); add_action( 'woocommerce_installed', array( $this, 'add_woocommerce_inbox_variant' ) ); add_action( 'woocommerce_updated', array( $this, 'add_woocommerce_inbox_variant' ) ); self::add_action( 'rest_api_init', array( $this, 'register_wp_admin_settings' ) ); add_action( 'woocommerce_installed', array( $this, 'add_woocommerce_remote_variant' ) ); add_action( 'woocommerce_updated', array( $this, 'add_woocommerce_remote_variant' ) ); add_action( 'woocommerce_newly_installed', 'wc_set_hooked_blocks_version', 10 ); self::add_filter( 'robots_txt', array( $this, 'robots_txt' ) ); add_filter( 'wp_plugin_dependencies_slug', array( $this, 'convert_woocommerce_slug' ) ); self::add_filter( 'woocommerce_register_log_handlers', array( $this, 'register_remote_log_handler' ) ); // These classes set up hooks on instantiation. $container = wc_get_container(); $container->get( ProductDownloadDirectories::class ); $container->get( DownloadPermissionsAdjuster::class ); $container->get( AssignDefaultCategory::class ); $container->get( DataRegenerator::class ); $container->get( LookupDataStore::class ); $container->get( MatchImageBySKU::class ); $container->get( RestockRefundedItemsAdjuster::class ); $container->get( CustomOrdersTableController::class ); $container->get( OptionSanitizer::class ); $container->get( BatchProcessingController::class ); $container->get( FeaturesController::class ); $container->get( WebhookUtil::class ); $container->get( Marketplace::class ); $container->get( TimeUtil::class ); $container->get( ComingSoonAdminBarBadge::class ); $container->get( ComingSoonCacheInvalidator::class ); $container->get( ComingSoonRequestHandler::class ); /** * These classes have a register method for attaching hooks. * * @var RegisterHooksInterface[] $hook_register_classes */ $hook_register_classes = $container->get( RegisterHooksInterface::class ); foreach ( $hook_register_classes as $hook_register_class ) { $hook_register_class->register(); } }