Merged in feature/314-dev-dev01 (pull request #24)
auto-patch 314-dev-dev01-2024-01-25T04_09_02 * auto-patch 314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
@@ -119,6 +119,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
|
||||
/**
|
||||
* Add extra default options received from a filter.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function enrich_defaults() {
|
||||
$extra_defaults_per_term = apply_filters( 'wpseo_add_extra_taxmeta_term_defaults', [] );
|
||||
@@ -291,7 +293,7 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
break;
|
||||
}
|
||||
|
||||
$clean[ $key ] = apply_filters( 'wpseo_sanitize_tax_meta_' . $key, $clean[ $key ], ( isset( $meta_data[ $key ] ) ? $meta_data[ $key ] : null ), ( isset( $old_meta[ $key ] ) ? $old_meta[ $key ] : null ) );
|
||||
$clean[ $key ] = apply_filters( 'wpseo_sanitize_tax_meta_' . $key, $clean[ $key ], ( $meta_data[ $key ] ?? null ), ( $old_meta[ $key ] ?? null ) );
|
||||
}
|
||||
|
||||
// Only save the non-default values.
|
||||
@@ -438,6 +440,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
* @param int $term_id ID of the term to save data for.
|
||||
* @param string $taxonomy The taxonomy the term belongs to.
|
||||
* @param array $meta_values The values that will be saved.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function set_values( $term_id, $taxonomy, array $meta_values ) {
|
||||
/* Validate the post values */
|
||||
@@ -454,6 +458,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
* @param string $taxonomy The taxonomy the term belongs to.
|
||||
* @param string $meta_key The target meta key to store the value in.
|
||||
* @param string $meta_value The value of the target meta key.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function set_value( $term_id, $taxonomy, $meta_key, $meta_value ) {
|
||||
|
||||
@@ -496,6 +502,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
* @param int $term_id ID of the term to save data for.
|
||||
* @param string $taxonomy The taxonomy the term belongs to.
|
||||
* @param array $clean Array with clean values.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function save_clean_values( $term_id, $taxonomy, array $clean ) {
|
||||
$tax_meta = self::get_tax_meta();
|
||||
@@ -530,6 +538,8 @@ class WPSEO_Taxonomy_Meta extends WPSEO_Option {
|
||||
* Saving the tax meta values to the database.
|
||||
*
|
||||
* @param array $tax_meta Array with the meta values for taxonomy.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function save_tax_meta( $tax_meta ) {
|
||||
update_option( self::$name, $tax_meta );
|
||||
|
||||
Reference in New Issue
Block a user