WPSEO_Taxonomy_Meta::set_value
Setting a single value to the term meta.
Метод класса: WPSEO_Taxonomy_Meta{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$result = WPSEO_Taxonomy_Meta::set_value( $term_id, $taxonomy, $meta_key, $meta_value );
- $term_id(int) (обязательный)
- ID of the term to save data for.
- $taxonomy(строка) (обязательный)
- The taxonomy the term belongs to.
- $meta_key(строка) (обязательный)
- The target meta key to store the value in.
- $meta_value(строка) (обязательный)
- The value of the target meta key.
Код WPSEO_Taxonomy_Meta::set_value() WPSEO Taxonomy Meta::set value Yoast 28.0
public static function set_value( $term_id, $taxonomy, $meta_key, $meta_value ) {
if ( substr( strtolower( $meta_key ), 0, 6 ) !== 'wpseo_' ) {
$meta_key = 'wpseo_' . $meta_key;
}
self::set_values( $term_id, $taxonomy, [ $meta_key => $meta_value ] );
}