Advertisement
phpface

Untitled

Dec 9th, 2015
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. if( ! function_exists( 'redirect_user_to_submit_page_after_successful_login' ) ){
  2.     /**
  3.      * @param unknown_type $redirect_to
  4.      * @param unknown_type $request
  5.      * @param unknown_type $user
  6.      * @return Ambigous <string, mixed>|unknown
  7.      */
  8.     function redirect_user_to_submit_page_after_successful_login( $redirect_to, $request = null, $user = null ) {
  9.         /**
  10.          * Submit page ID
  11.          * @var int
  12.          *
  13.          */
  14.         $submit_page_id = '100';   
  15.         if( isset( $user ) || absint( $request ) ){
  16.             return esc_url( get_permalink( $submit_page_id ) );
  17.         }
  18.         return $redirect_to;
  19.     }
  20.     add_filter( 'login_redirect' , 'redirect_user_to_submit_page_after_successful_login', 100, 3 );
  21.     add_filter( 'vt_logged_redirect_to' , 'redirect_user_to_submit_page_after_successful_login', 100, 2 );
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement