Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( ! function_exists( 'videotube_vt_logged_redirect_to' ) ){
- /**
- * Redirect the user to their channel page on theme forms.
- * @param unknown_type $redirect_to
- * @param unknown_type $user_id
- * @return Ambigous <string, mixed>
- */
- function videotube_vt_logged_redirect_to( $redirect_to, $user_id ) {
- return get_author_posts_url( $user_id );
- }
- add_filter('vt_logged_redirect_to', 'videotube_vt_logged_redirect_to' , 100 , 2 );
- }
- if( ! function_exists( 'videotube_default_login_redirect' ) ){
- /**
- * Redirect the user to their channel page on WP default login form.
- * @param unknown_type $redirect_to
- * @param unknown_type $request
- * @param unknown_type $user
- * @return Ambigous <string, mixed>
- */
- function videotube_default_login_redirect( $redirect_to, $request, $user ) {
- if( isset( $user->ID ) ){
- $redirect_to = get_author_posts_url( $user->ID );
- }
- return $redirect_to;
- }
- add_filter( 'login_redirect', 'videotube_default_login_redirect', 10, 3 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement