Skip to content

Commit

Permalink
Social: Fix auto-conversion cleanup logic (#34666)
Browse files Browse the repository at this point in the history
* Fix logic to be mindful of absent option

* changelog

* Fixup versions
  • Loading branch information
gmjuhasz authored Dec 15, 2023
1 parent 2a19836 commit 431a25f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Social: Fixed issue with auto-conversion option logic
2 changes: 1 addition & 1 deletion projects/packages/publicize/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize",
"version": "0.38.1",
"version": "0.38.2-alpha",
"description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ private function migrate_old_option() {
}
// Checking if the new option is valid.
$auto_conversion_settings = get_option( self::OPTION_PREFIX . self::AUTOCONVERT_IMAGES );
if ( ! is_array( $auto_conversion_settings ) || ! isset( $auto_conversion_settings['enabled'] ) ) {
// If the option is not set, we don't need to delete it.
// If it is set, but it is not an array or it does not have the enabled key, we delete it.
if ( false !== $auto_conversion_settings && ( ! is_array( $auto_conversion_settings ) || ! isset( $auto_conversion_settings['enabled'] ) ) ) {
delete_option( self::OPTION_PREFIX . self::AUTOCONVERT_IMAGES );
}

Expand Down

0 comments on commit 431a25f

Please sign in to comment.