Making WordPress.org


Ignore:
Timestamp:
05/16/2024 03:06:24 AM (18 months ago)
Author:
dd32
Message:

Plugin Direcrory: When Release Confirmation is enabled, and a tag for a non-confirmed release is deleted, remove the release.

Fixes #5900.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r13637 r13711  
    7878     * @param string $plugin_slug            The slug of the plugin to import.
    7979     * @param array  $svn_changed_tags       A list of tags/trunk which the SVN change touched. Optional.
     80     * @param array  $svn_tags_deleted       A list of tags/trunk which were deleted in the SVN change. Optional.
    8081     * @param array  $svn_revision_triggered The SVN revision which this import has been triggered by. Optional.
    8182     */
    82     public function import_from_svn( $plugin_slug, $svn_changed_tags = array( 'trunk' ), $svn_revision_triggered = 0 ) {
     83    public function import_from_svn( $plugin_slug, $svn_changed_tags = array( 'trunk' ), $svn_tags_deleted = array(), $svn_revision_triggered = 0 ) {
    8384        // Reset properties.
    8485        $this->warnings = [];
     
    192193
    193194                    echo "Plugin release {$svn_changed_tag} not confirmed; email triggered.\n";
     195                }
     196            }
     197
     198            // Check to see if any of the releases were deleted.
     199            foreach ( $svn_tags_deleted as $svn_deleted_tag ) {
     200                // Note: Confirmed releases will not be deleted, only unconfirmed ones.
     201                if ( Plugin_Directory::remove_release( $plugin, $svn_deleted_tag ) ) {
     202                    echo "Plugin tag {$svn_deleted_tag} deleted; release removed.\n";
    194203                }
    195204            }
Note: See TracChangeset for help on using the changeset viewer.