WC_Admin_Taxonomies::handle_product_cat_row_actions()publicWC 1.0

Handle custom row actions.

Method of the class: WC_Admin_Taxonomies{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Taxonomies = new WC_Admin_Taxonomies();
$WC_Admin_Taxonomies->handle_product_cat_row_actions();

WC_Admin_Taxonomies::handle_product_cat_row_actions() code WC 9.4.2

public function handle_product_cat_row_actions() {
	if ( isset( $_GET['action'], $_GET['tag_ID'], $_GET['_wpnonce'] ) && 'make_default' === $_GET['action'] ) { // WPCS: CSRF ok, input var ok.
		$make_default_id = absint( $_GET['tag_ID'] ); // WPCS: Input var ok.

		if ( wp_verify_nonce( $_GET['_wpnonce'], 'make_default_' . $make_default_id ) && current_user_can( 'edit_term', $make_default_id ) ) { // WPCS: Sanitization ok, input var ok, CSRF ok.
			update_option( 'default_product_cat', $make_default_id );
		}
	}
}