woocommerce_before_attribute_delete

woocommerce_before_attribute_delete

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_before_attribute_delete') is found 1 times:

  • /includes/wc-attribute-functions.php line 684
    	 * @param int    $id       Attribute ID.
    	 * @param string $name     Attribute name.
    	 * @param string $taxonomy Attribute taxonomy name.
    	 */
    	do_action( 'woocommerce_before_attribute_delete', $id, $name, $taxonomy );
    
    	if ( $name && $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_id = %d", $id ) ) ) {
    		if ( taxonomy_exists( $taxonomy ) ) {
    			$terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
    			foreach ( $terms as $term ) {
    				wp_delete_term( $term->term_id, $taxonomy );