Making WordPress.org


Ignore:
Timestamp:
08/06/2020 08:31:07 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Convert Plugin Approved/Rejected emails over to the new Email class.

Additionally, this causes rejected emails not to be sent to blocked users and updates the text slightly.
Props Ipstenu.

See #5351.
Fixes #5354.

File:
1 edited

Legend:

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

    r10121 r10124  
    3131    public function __construct( $plugin, $users, $args = array() ) {
    3232        $this->plugin = Plugin_Directory::get_plugin_post( $plugin );
     33
     34        // Don't cast an object to an array, but rather an array of object.
     35        if ( is_object( $users ) ) {
     36            $users = [ $users ];
     37        }
    3338
    3439        foreach ( (array) $users as $user ) {
     
    109114
    110115        // Blocked users don't need emails.
    111         if ( !empty( $this->user->caps[ 'bbp_blocked'] ) ) {
     116        if ( ! empty( $this->user->caps[ 'bbp_blocked'] ) ) {
    112117            return false;
    113118        }
Note: See TracChangeset for help on using the changeset viewer.