WC_Admin_Post_Types::bulk_and_quick_edit_hook()publicWC 3.0.0

Offers a way to hook into save post without causing an infinite loop when quick/bulk saving product info.

Метод класса: WC_Admin_Post_Types{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->bulk_and_quick_edit_hook( $post_id, $post );
$post_id(int) (обязательный)
Post ID being saved.
$post(объект) (обязательный)
Post object being saved.

Список изменений

С версии 3.0.0 Введена.

Код WC_Admin_Post_Types::bulk_and_quick_edit_hook() WC 8.7.0

public function bulk_and_quick_edit_hook( $post_id, $post ) {
	remove_action( 'save_post', array( $this, 'bulk_and_quick_edit_hook' ) );
	do_action( 'woocommerce_product_bulk_and_quick_edit', $post_id, $post );
	add_action( 'save_post', array( $this, 'bulk_and_quick_edit_hook' ), 10, 2 );
}