From 7f8f70f753072de2071ed0443c7d7749bed5204a Mon Sep 17 00:00:00 2001 From: Matt Thiessen Date: Mon, 17 Sep 2018 16:13:19 -0500 Subject: [PATCH] fix this vs self errors using static function --- inc/AppPresser_Ajax_Extras.php | 6 +++--- inc/AppPresser_WPAPI_Mods.php | 22 ++-------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/inc/AppPresser_Ajax_Extras.php b/inc/AppPresser_Ajax_Extras.php index 90ff522..17e371a 100644 --- a/inc/AppPresser_Ajax_Extras.php +++ b/inc/AppPresser_Ajax_Extras.php @@ -79,7 +79,7 @@ public function appp_ajax_login() { 'message' => apply_filters( 'appp_login_success', sprintf( __('Welcome back %s!', 'apppresser'), $user_signon->display_name), $user_signon->ID ), 'username' => $info['user_login'], 'avatar' => get_avatar_url( $user_signon->ID ), - 'login_redirect' => $this->get_login_redirect(), // v3 only + 'login_redirect' => self::get_login_redirect(), // v3 only 'success' => true ); @@ -97,12 +97,12 @@ public function appp_ajax_login() { * @since 3.2.1 * @return string | array( 'url' => '', 'title' => '' ) */ - public function get_login_redirect() { + public static function get_login_redirect() { if( has_filter( 'appp_login_redirect' ) ) { $redirect_to = apply_filters( 'appp_login_redirect', '' ); - return $this->add_redirect_title( $redirect_to ); + return self::add_redirect_title( $redirect_to ); } else { return ''; diff --git a/inc/AppPresser_WPAPI_Mods.php b/inc/AppPresser_WPAPI_Mods.php index 45d8114..d8f92be 100644 --- a/inc/AppPresser_WPAPI_Mods.php +++ b/inc/AppPresser_WPAPI_Mods.php @@ -246,7 +246,7 @@ public function api_login( $request ) { 'message' => apply_filters( 'appp_login_success', sprintf( __('Welcome back %s!', 'apppresser'), $user_signon->display_name), $user_signon->ID ), 'username' => $info['user_login'], 'avatar' => get_avatar_url( $user_signon->ID ), - 'login_redirect' => $this->get_login_redirect(), // v3 only + 'login_redirect' => AppPresser_Ajax_Extras::get_login_redirect(), // v3 only 'success' => true ); @@ -495,24 +495,6 @@ public function check_app_unverified( $user, $password ) { } - /** - * Get the login redirect for the app's login modal - * - * @since 3.2.1 - * @return string | array( 'url' => '', 'title' => '' ) - */ - public function get_login_redirect() { - - if( has_filter( 'appp_login_redirect' ) ) { - $redirect_to = apply_filters( 'appp_login_redirect', '' ); - - return $this->add_redirect_title( $redirect_to ); - - } else { - return ''; - } - } - /** * Get the login redirect for the app's login modal * @@ -524,7 +506,7 @@ public function get_logout_redirect() { if( has_filter( 'appp_logout_redirect' ) ) { $redirect_to = apply_filters( 'appp_logout_redirect', '' ); - return self::add_redirect_title( $redirect_to ); + return AppPresser_Ajax_Extras::add_redirect_title( $redirect_to ); } else { return '';