woocommerce_before_attribute_delete

woocommerce_before_attribute_delete

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_before_attribute_delete') is found 1 times:

  • /includes/wc-attribute-functions.php line 696
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    * @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 );