Making WordPress.org


Ignore:
Timestamp:
08/28/2020 05:36:38 AM (4 years ago)
Author:
dd32
Message:

Plugin Directory: Add an initial run at Release Confirmation for plugins.

This is currently only enabled for plugin review members, as it needs some testing in production prior to being available to others.

Notably, this requires that a plugin be using tagged releases, it doesn't handle trunk releases (yet), that will be added next.

See: #5352

File:
1 edited

Legend:

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

    r10124 r10214  
    2525
    2626    /**
    27      * @param $plugin The plugin this email relates to.
     27     * @param $plugin  The plugin this email relates to.
    2828     * @param $users[] A list of users to email.
    29      * @param $args[] A list of args that the email requires.
     29     * @param $args[]  A list of args that the email requires.
    3030     */
    31     public function __construct( $plugin, $users, $args = array() ) {
    32         $this->plugin = Plugin_Directory::get_plugin_post( $plugin );
     31    public function __construct( $plugin, $users = [], $args = [] ) {
     32
     33        // Sometimes we don't have a plugin context, just a user..
     34        if ( $plugin instanceOf WP_User ) {
     35            $users = [ $plugin ];
     36            $args  = $users; // Just assume that args will have been passed in there.
     37
     38            $this->plugin = true; // To pass checks..
     39        } else {
     40            $this->plugin = Plugin_Directory::get_plugin_post( $plugin );
     41        }
    3342
    3443        // Don't cast an object to an array, but rather an array of object.
Note: See TracChangeset for help on using the changeset viewer.