Making WordPress.org


Ignore:
Timestamp:
04/15/2024 07:49:00 AM (19 months ago)
Author:
dd32
Message:

Plugin Directory: Upload: Keep track of the plugin names used during initial plugin submission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php

    r13462 r13526  
    504504        update_post_meta( $plugin_post->ID, '_submitted_zip_loc', $lines_of_code );
    505505
     506        // Keep a log of all plugin names used by the plugin over time.
     507        $plugin_names = get_post_meta( $plugin_post->ID, 'plugin_name_history', true ) ?: [];
     508        if ( ! isset( $plugin_names[ $this->plugin['Name'] ] ) ) {
     509            // [ 'Plugin Name' => '1.2.3', 'Plugin New Name' => '4.5.6' ]
     510            $plugin_names[ $this->plugin['Name'] ] = $this->plugin['Version'];
     511            update_post_meta( $plugin_post->ID, 'plugin_name_history', wp_slash( $plugin_names ) );
     512        }
     513
    506514        do_action( 'plugin_upload', $this->plugin, $plugin_post );
    507515
Note: See TracChangeset for help on using the changeset viewer.