Make WordPress Core

Ticket #53613: 53613-pre-term-deletion.diff

File 53613-pre-term-deletion.diff, 742 bytes (added by anonymized_18703099, 3 years ago)

Patch

  • src/wp-includes/taxonomy.php

    diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
    index 5d9cf1ad2c..8ca2d81159 100644
    a b function wp_delete_term( $term, $taxonomy, $args = array() ) { 
    19091909                return $ids;
    19101910        }
    19111911
     1912        /**
     1913         * Filters whether a term deletion should take place.
     1914         *
     1915         * @since 5.9.0
     1916         *
     1917         * @param bool|null $delete       Whether to go forward with deletion.
     1918         * @param WP_Term   $term         Term object.
     1919         * @param string    $taxonomy     Taxonomy Name.
     1920         */
     1921        $check = apply_filters( 'pre_term_deletion', null, $term, $taxonomy );
     1922        if ( null !== $check ) {
     1923                return $check;
     1924        }
     1925
    19121926        $tt_id = $ids['term_taxonomy_id'];
    19131927
    19141928        $defaults = array();