/** * @param WP_User|int|string|null $user * @param array $args */ function __construct($user, $args = array()) { if (!is_null($user)) { $this->_user = WPLib_Users::get_user($user); } $args = wp_parse_args($args, array('model' => array('user' => $user))); parent::__construct($args); }
/** * @param WP_User|object|null $user * @param array $args */ function __construct($user, $args = array()) { /* * Find the user if possible */ $this->_user = WPLib_Users::get_user($user); /* * Let our parent class capture whatever properties where passed in as $args */ parent::__construct($args); }