Changeset 10214 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-base.php
- Timestamp:
- 08/28/2020 05:36:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/email/class-base.php
r10124 r10214 25 25 26 26 /** 27 * @param $plugin The plugin this email relates to.27 * @param $plugin The plugin this email relates to. 28 28 * @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. 30 30 */ 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 } 33 42 34 43 // Don't cast an object to an array, but rather an array of object.
Note: See TracChangeset
for help on using the changeset viewer.