Skip to content

Commit

Permalink
Merge pull request #21364 from Yoast/fix-import-wpseo-titles
Browse files Browse the repository at this point in the history
Fix import of `wpseo_titles`
  • Loading branch information
leonidasmi authored May 13, 2024
2 parents ffbe015 + 23b32fa commit c562199
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
40 changes: 0 additions & 40 deletions inc/options/class-wpseo-option-titles.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,46 +874,6 @@ protected function clean_option( $option_value, $current_version = null, $all_ol
unset( $rename, $taxonomy_names, $post_type_names, $defaults, $tax, $old_prefix, $new_prefix );
}

/*
* Make sure the values of the variable option key options are cleaned as they
* may be retained and would not be cleaned/validated then.
*/
if ( is_array( $option_value ) && $option_value !== [] ) {
foreach ( $option_value as $key => $value ) {
$switch_key = $this->get_switch_key( $key );

// Similar to validation routine - any changes made there should be made here too.
switch ( $switch_key ) {
/* Text fields. */
case 'title-':
case 'metadesc-':
case 'bctitle-ptarchive-':
$option_value[ $key ] = WPSEO_Utils::sanitize_text_field( $value );
break;

case 'separator':
if ( ! array_key_exists( $value, $this->get_separator_options() ) ) {
$option_value[ $key ] = false;
}
break;

/*
* Boolean fields.
*/

/*
* Covers:
* 'noindex-'
* 'hideeditbox-'
*/
default:
$option_value[ $key ] = WPSEO_Utils::validate_bool( $value );
break;
}
}
unset( $key, $value, $switch_key );
}

return $option_value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const FormikMediaSelectField = ( {
const fallbackMedia = useSelectSettings( "selectMediaById", [ fallbackMediaId ], fallbackMediaId );
const { fetchMedia, addOneMedia } = useDispatchSettings();
const error = useMemo( () => get( errors, mediaIdName, "" ), [ errors, mediaIdName ] );
const disabled = useMemo( () => isDisabled || isDummy || isMediaError, [ isDummy, isDisabled, isMediaError ] );
const disabled = useMemo( () => isDisabled || isDummy, [ isDummy, isDisabled ] );
const { ids: describedByIds, describedBy } = useDescribedBy( `field-${ id }-id`, { description, error } );
const previewMedia = useMemo( () => {
if ( mediaId > 0 ) {
Expand Down

0 comments on commit c562199

Please sign in to comment.