Trigger error when calling the deprecated getCurrentWPUser() function

[MAILPOET-3268]
This commit is contained in:
wxa
2021-03-15 13:05:16 +03:00
committed by Veljko V
parent 3b0af31b10
commit 309ab2b3c0

View File

@@ -111,6 +111,7 @@ class Subscriber extends Model {
* @deprecated Use the version in \MailPoet\Subscribers\SubscribersRepository::getCurrentWPUser
*/
public static function getCurrentWPUser() {
trigger_error('Calling Subscriber::getCurrentWPUser() is deprecated and will be removed. Use MailPoet\Subscribers\SubscribersRepository::getCurrentWPUser(). ', E_USER_DEPRECATED);
$wpUser = WPFunctions::get()->wpGetCurrentUser();
if (empty($wpUser->ID)) {
return false; // Don't look up a subscriber for guests