-
Notifications
You must be signed in to change notification settings - Fork 0
/
login-redirect.php
42 lines (31 loc) · 1015 Bytes
/
login-redirect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
Plugin Name: WPUF login redirect
Plugin URI: https://wordpress.org/plugins/wpuf-login-redirect
Description: Login redirect for Wp user frontend
Version: 0.2
Author: Nayem
Author URI: https://twitter.com/nayemDevs
License: GPL2
TextDomain : wpuf
*/
// Adding filter from WP User Fronted plugin
add_filter('wpuf_login_redirect' , 'wlr_login_redirect');
function wlr_login_redirect($redirect){
$redirect = get_permalink(wpuf_get_option( 'page_url', 'wpuf_general' ) );
return $redirect;
}
// Adding extra option in General settings of WPUF
add_filter( 'wpuf_options_others', 'wlr_menu_option');
function wlr_menu_option( $settings_fields ){
$pages = wpuf_get_pages();
$settings_fields[] = array(
'name' => 'page_url',
'label' => __( 'Select redirect page ', 'wpuf' ),
'desc' => __( 'Select the page to redirect user after login', 'wpuf' ),
'type' => 'select',
'options' => $pages
);
return $settings_fields;
}
?>