Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Improve the inline comment on what the array_intersect() is doing.
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiron committed May 17, 2020
1 parent 1ded48f commit 46e9f1e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function wp_autoupdates_handle_plugins_enable_disable() {

$auto_updates[] = $plugin;
$auto_updates = array_unique( $auto_updates );
// Remove plugins that have been deleted since the site option was last updated.
// Remove plugins that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_plugins', $auto_updates );
Expand All @@ -389,7 +389,7 @@ function wp_autoupdates_handle_plugins_enable_disable() {
$auto_updates = get_site_option( 'wp_auto_update_plugins', array() );

$auto_updates = array_diff( $auto_updates, array( $plugin ) );
// Remove plugins that have been deleted since the site option was last updated.
// Remove plugins that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_plugins', $auto_updates );
Expand Down Expand Up @@ -429,7 +429,7 @@ function wp_autoupdates_handle_themes_enable_disable() {

$auto_updates[] = $_GET['theme'];
$auto_updates = array_unique( $auto_updates );
// Remove themes that have been deleted since the site option was last updated.
// Remove themes that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_themes', $auto_updates );
Expand All @@ -451,7 +451,7 @@ function wp_autoupdates_handle_themes_enable_disable() {
$auto_updates = get_site_option( 'wp_auto_update_themes', array() );

$auto_updates = array_diff( $auto_updates, array( $_GET['theme'] ) );
// Remove themes that have been deleted since the site option was last updated.
// Remove themes that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_themes', $auto_updates );
Expand Down Expand Up @@ -508,7 +508,7 @@ function wp_autoupdates_plugins_bulk_actions_handle( $redirect_to, $doaction, $i

/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
$all_items = apply_filters( 'all_plugins', get_plugins() );
// Remove plugins that have been deleted since the site option was last updated.
// Remove plugins that do not exist or have been deleted since the site option was last updated.
$new_auto_updates = array_intersect( $new_auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_plugins', $new_auto_updates );
Expand Down Expand Up @@ -549,7 +549,7 @@ function wp_autoupdates_plugins_bulk_actions_handle( $redirect_to, $doaction, $i

/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
$all_items = apply_filters( 'all_plugins', get_plugins() );
// Remove plugins that have been deleted since the site option was last updated.
// Remove plugins that do not exist or have been deleted since the site option was last updated.
$new_auto_updates = array_intersect( $new_auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_plugins', $new_auto_updates );
Expand Down Expand Up @@ -647,7 +647,7 @@ function wp_autoupdates_plugins_status_links( $status_links ) {
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
$all_plugins = apply_filters( 'all_plugins', get_plugins() );
$auto_updates = (array) get_site_option( 'wp_auto_update_plugins', array() );
// Remove plugins that have been deleted since the site option was last updated.
// Remove plugins that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_plugins ) );
$enabled_count = count( $auto_updates );

Expand Down Expand Up @@ -1243,7 +1243,7 @@ function wp_autoupdates_themes_bulk_actions_handle( $redirect_to, $doaction, $it

$auto_updates = array_merge( $auto_updates, $themes );
$auto_updates = array_unique( $auto_updates );
// Remove themes that have been deleted since the site option was last updated.
// Remove themes that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_themes', $auto_updates );
Expand All @@ -1268,7 +1268,7 @@ function wp_autoupdates_themes_bulk_actions_handle( $redirect_to, $doaction, $it
$auto_updates = (array) get_site_option( 'wp_auto_update_themes', array() );

$auto_updates = array_diff( $auto_updates, $themes );
// Remove themes that have been deleted since the site option was last updated.
// Remove themes that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( 'wp_auto_update_themes', $auto_updates );
Expand Down Expand Up @@ -1341,7 +1341,7 @@ function wp_autoupdates_toggle_auto_updates() {
$auto_updates = array_unique( $auto_updates );
}

// Remove items that have been deleted since the site option was last updated.
// Remove items that do not exist or have been deleted since the site option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );

update_site_option( $option, $auto_updates );
Expand Down

0 comments on commit 46e9f1e

Please sign in to comment.