acf_form_taxonomy::delete_term()
delete_term
description
Метод класса: acf_form_taxonomy{}
Хуков нет.
Возвращает
$post_id
. (int)
Использование
$acf_form_taxonomy = new acf_form_taxonomy(); $acf_form_taxonomy->delete_term( $term, $tt_id, $taxonomy, $deleted_term );
- $term (обязательный)
- -
- $tt_id (обязательный)
- -
- $taxonomy (обязательный)
- -
- $deleted_term (обязательный)
- -
Список изменений
С версии 5.0.0 | Введена. |
Код acf_form_taxonomy::delete_term() acf form taxonomy::delete term ACF 6.0.4
function delete_term( $term, $tt_id, $taxonomy, $deleted_term ) { // bail early if termmeta table exists if ( acf_isset_termmeta() ) { return $term; } // globals global $wpdb; // vars $search = $taxonomy . '_' . $term . '_%'; $_search = '_' . $search; // escape '_' // http://stackoverflow.com/questions/2300285/how-do-i-escape-in-sql-server $search = str_replace( '_', '\_', $search ); $_search = str_replace( '_', '\_', $_search ); // delete $result = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s OR option_name LIKE %s", $search, $_search ) ); }