Automattic\WooCommerce\Internal\Fulfillments

FulfillmentsRenderer::init_admin_hookspublicWC 1.0

Initialize the hooks that should run after admin_init

Method of the class: FulfillmentsRenderer{}

No Hooks.

Returns

null. Nothing (null).

Usage

$FulfillmentsRenderer = new FulfillmentsRenderer();
$FulfillmentsRenderer->init_admin_hooks();

FulfillmentsRenderer::init_admin_hooks() code WC 10.3.3

public function init_admin_hooks() {
	if ( OrderUtil::custom_orders_table_usage_is_enabled() ) {
		// For custom orders table, we need to add the bulk actions to the custom orders table.
		add_filter( 'bulk_actions-woocommerce_page_wc-orders', array( $this, 'define_fulfillment_bulk_actions' ) );
		add_filter( 'handle_bulk_actions-woocommerce_page_wc-orders', array( $this, 'handle_fulfillment_bulk_actions' ), 10, 3 );
		// For custom orders table, we need to filter the query to include fulfillment status.
		add_action( 'woocommerce_order_list_table_restrict_manage_orders', array( $this, 'render_fulfillment_filters' ) );
		add_filter( 'woocommerce_order_query_args', array( $this, 'filter_orders_list_table_query' ), 10, 1 );
	} else {
		// For legacy orders table, we need to add the bulk actions to the legacy orders table.
		add_filter( 'bulk_actions-edit-shop_order', array( $this, 'define_fulfillment_bulk_actions' ) );
		add_filter( 'handle_bulk_actions-edit-shop_order', array( $this, 'handle_fulfillment_bulk_actions' ), 10, 3 );
		// For legacy orders table, we need to filter the query to include fulfillment status.
		add_action( 'restrict_manage_posts', array( $this, 'render_fulfillment_filters_legacy' ) );
		add_action( 'pre_get_posts', array( $this, 'filter_legacy_orders_list_query' ) );
	}
}