Skip to content

Commit

Permalink
fix this vs self errors using static function
Browse files Browse the repository at this point in the history
  • Loading branch information
stillatmylinux committed Sep 17, 2018
1 parent ff0d48c commit 7f8f70f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
6 changes: 3 additions & 3 deletions inc/AppPresser_Ajax_Extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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 '';
Expand Down
22 changes: 2 additions & 20 deletions inc/AppPresser_WPAPI_Mods.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down Expand Up @@ -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
*
Expand All @@ -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 '';
Expand Down

0 comments on commit 7f8f70f

Please sign in to comment.