Skip to content

Commit

Permalink
Add defensive coding to the upgrade function
Browse files Browse the repository at this point in the history
  • Loading branch information
enricobattocchi committed Mar 22, 2024
1 parent 1cdd079 commit 98b699a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function duplicate_post_plugin_upgrade() {
);
add_option( 'duplicate_post_show_link_in', $show_links_in_defaults );

$taxonomies_blacklist = get_option( 'duplicate_post_taxonomies_blacklist' );
if ( $taxonomies_blacklist === '' ) {
$taxonomies_blacklist = get_option( 'duplicate_post_taxonomies_blacklist', [] );
if ( empty( $taxonomies_blacklist ) ) {
$taxonomies_blacklist = [];
}
if ( in_array( 'post_format', $taxonomies_blacklist, true ) ) {
Expand Down

0 comments on commit 98b699a

Please sign in to comment.