acf_form_taxonomy::save_term
description
Метод класса: acf_form_taxonomy{}
Хуков нет.
Возвращает
$post_id. (int)
Использование
$acf_form_taxonomy = new acf_form_taxonomy(); $acf_form_taxonomy->save_term( $term_id, $tt_id, $taxonomy );
- $term_id(обязательный)
- .
- $tt_id(обязательный)
- .
- $taxonomy(обязательный)
- .
Список изменений
| С версии 5.0.0 | Введена. |
Код acf_form_taxonomy::save_term() acf form taxonomy::save term ACF 6.8.11
function save_term( $term_id, $tt_id, $taxonomy ) {
// vars
$post_id = 'term_' . $term_id;
// verify and remove nonce
if ( ! acf_verify_nonce( 'taxonomy' ) ) {
return $term_id;
}
// Only accept fields rendered for this term (or the taxonomy's Add form), or from field groups located on the taxonomy.
acf_restrict_save_input(
array(
'context' => 'taxonomy',
'post_id' => $post_id,
'render_ids' => array( current_action() === 'create_term' ? 'term_0/' . $taxonomy : $post_id ),
'screen' => array( 'taxonomy' => $taxonomy ),
)
);
// valied and show errors
acf_validate_save_post( true );
// save
acf_save_post( $post_id );
}