WC_Admin_Taxonomies::product_cat_row_actions()
Adjust row actions.
Method of the class: WC_Admin_Taxonomies{}
No Hooks.
Return
Array
.
Usage
$WC_Admin_Taxonomies = new WC_Admin_Taxonomies(); $WC_Admin_Taxonomies->product_cat_row_actions( $actions, $term );
- $actions(array) (required)
- Array of actions.
- $term(object) (required)
- Term object.
WC_Admin_Taxonomies::product_cat_row_actions() WC Admin Taxonomies::product cat row actions code WC 9.4.2
public function product_cat_row_actions( $actions, $term ) { $default_category_id = absint( get_option( 'default_product_cat', 0 ) ); if ( $default_category_id !== $term->term_id && current_user_can( 'edit_term', $term->term_id ) ) { $actions['make_default'] = sprintf( '<a href="%s" aria-label="%s">%s</a>', wp_nonce_url( 'edit-tags.php?action=make_default&taxonomy=product_cat&post_type=product&tag_ID=' . absint( $term->term_id ), 'make_default_' . absint( $term->term_id ) ), /* translators: %s: taxonomy term name */ esc_attr( sprintf( __( 'Make “%s” the default category', 'woocommerce' ), $term->name ) ), __( 'Make default', 'woocommerce' ) ); } return $actions; }