/** * Update the taxonomy meta data on save. * * @param int $term_id ID of the term to save data for. * @param int $tt_id The taxonomy_term_id for the term. * @param string $taxonomy The taxonomy the term belongs to. */ public function update_term($term_id, $tt_id, $taxonomy) { /* Create post array with only our values */ $new_meta_data = array(); foreach (WPSEO_Taxonomy_Meta::$defaults_per_term as $key => $default) { if ($posted_value = filter_input(INPUT_POST, $key)) { $new_meta_data[$key] = $posted_value; } } unset($key, $default); // Saving the values. WPSEO_Taxonomy_Meta::set_values($term_id, $taxonomy, $new_meta_data); }
/** * Update the taxonomy meta data on save. * * @param int $term_id ID of the term to save data for. * @param int $tt_id The taxonomy_term_id for the term. * @param string $taxonomy The taxonomy the term belongs to. */ public function update_term($term_id, $tt_id, $taxonomy) { /* Create post array with only our values */ $new_meta_data = array(); foreach (WPSEO_Taxonomy_Meta::$defaults_per_term as $key => $default) { if ($posted_value = filter_input(INPUT_POST, $key)) { $new_meta_data[$key] = $posted_value; } // If analysis is disabled remove that analysis score value from the DB. if ($this->is_meta_value_disabled($key)) { $new_meta_data[$key] = ''; } } unset($key, $default); // Saving the values. WPSEO_Taxonomy_Meta::set_values($term_id, $taxonomy, $new_meta_data); }