WPSEO_Taxonomy_Meta::save_clean_values()private staticYoast 1.0

Saving the values for the given term_id.

Метод класса: WPSEO_Taxonomy_Meta{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WPSEO_Taxonomy_Meta::save_clean_values( $term_id, $taxonomy, $clean );
$term_id(int) (обязательный)
ID of the term to save data for.
$taxonomy(строка) (обязательный)
The taxonomy the term belongs to.
$clean(массив) (обязательный)
Array with clean values.

Код WPSEO_Taxonomy_Meta::save_clean_values() Yoast 22.4

private static function save_clean_values( $term_id, $taxonomy, array $clean ) {
	$tax_meta = self::get_tax_meta();

	/* Add/remove the result to/from the original option value. */
	if ( $clean !== [] ) {
		$tax_meta[ $taxonomy ][ $term_id ] = $clean;
	}
	else {
		unset( $tax_meta[ $taxonomy ][ $term_id ] );
		if ( isset( $tax_meta[ $taxonomy ] ) && $tax_meta[ $taxonomy ] === [] ) {
			unset( $tax_meta[ $taxonomy ] );
		}
	}

	// Prevent complete array validation.
	$tax_meta['wpseo_already_validated'] = true;

	self::save_tax_meta( $tax_meta );
}