Peter’s Login Redirect - Version 2.9.6

Version Description

  • Added back php file url base redirect.
Download this release

Release Info

Developer Collizo4sky
Plugin Icon 128x128 Peter’s Login Redirect
Version 2.9.6
Comparing to
See all releases

Code changes from version 2.9.5 to 2.9.6

readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: login, logout, redirect, admin, administration, dashboard, users, authenti
5
  Requires at least: 4.0
6
  Requires PHP: 5.3
7
  Tested up to: 5.3
8
- Stable tag: 2.9.5
9
  License: GPL-2.0+
10
 
11
  Redirect users to different locations after logging in and logging out.
@@ -191,6 +191,9 @@ For a deeper dive into this feature, please [see this video](https://drive.googl
191
 
192
  == Changelog ==
193
 
 
 
 
194
  = 2.9.5 =
195
  * Fixed: logout redirect not working.
196
  * Remove php file redirect option. No longer used by many or used at all.
5
  Requires at least: 4.0
6
  Requires PHP: 5.3
7
  Tested up to: 5.3
8
+ Stable tag: 2.9.6
9
  License: GPL-2.0+
10
 
11
  Redirect users to different locations after logging in and logging out.
191
 
192
  == Changelog ==
193
 
194
+ = 2.9.6 =
195
+ * Added back php file url base redirect.
196
+
197
  = 2.9.5 =
198
  * Fixed: logout redirect not working.
199
  * Remove php file redirect option. No longer used by many or used at all.
wplogin_redirect.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.theblog.ca/wplogin-redirect
5
  Description: Redirect users to different locations after logging in. Define a set of rules for specific users, user with specific roles, users with specific capabilities, and a blanket rule for all other users. This is all managed in Settings > Login/logout redirects.
6
  Author: Peter Keung
7
  Author URI: http://www.theblog.ca
8
- Version: 2.9.5
9
  Text Domain: peters-login-redirect
10
  Domain Path: /languages/
11
  */
@@ -23,7 +23,7 @@ global $rul_db_addresses;
23
  global $rul_version;
24
  // Name of the database table that will hold group information and moderator rules
25
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
26
- $rul_version = '2.9.5';
27
 
28
  // doing this so we can pass current user logging out since it is no longer active after logout
29
  if ( ! function_exists('wp_logout')) :
@@ -353,7 +353,7 @@ class rulRedirectPostRegistration
353
  }
354
 
355
  // This function wraps around the main redirect function to determine whether or not to bypass the WordPress local URL limitation
356
- function redirect_wrapper($redirect_to, $requested_redirect_to, $user)
357
  {
358
  $rul_allow_post_redirect_override = rulRedirectFunctionCollection::get_settings('rul_allow_post_redirect_override');
359
 
@@ -1306,7 +1306,8 @@ if (is_admin()) {
1306
  register_activation_hook(__FILE__, 'rul_install');
1307
  register_uninstall_hook(__FILE__, 'rul_uninstall');
1308
 
1309
- add_filter('login_redirect', 'redirect_wrapper', 999999999, 3);
 
1310
  add_filter('registration_redirect', array('rulRedirectPostRegistration', 'post_registration_wrapper'), 10, 2);
1311
  // whichever one works. directly below might not work if wp_logout function is redefined before ours kicks in.
1312
  add_action('wp_logout', array('rulLogoutFunctionCollection', 'logout_redirect'), 1);
5
  Description: Redirect users to different locations after logging in. Define a set of rules for specific users, user with specific roles, users with specific capabilities, and a blanket rule for all other users. This is all managed in Settings > Login/logout redirects.
6
  Author: Peter Keung
7
  Author URI: http://www.theblog.ca
8
+ Version: 2.9.6
9
  Text Domain: peters-login-redirect
10
  Domain Path: /languages/
11
  */
23
  global $rul_version;
24
  // Name of the database table that will hold group information and moderator rules
25
  $rul_db_addresses = $wpdb->prefix . 'login_redirects';
26
+ $rul_version = '2.9.6';
27
 
28
  // doing this so we can pass current user logging out since it is no longer active after logout
29
  if ( ! function_exists('wp_logout')) :
353
  }
354
 
355
  // This function wraps around the main redirect function to determine whether or not to bypass the WordPress local URL limitation
356
+ function peters_redirect_wrapper($redirect_to, $requested_redirect_to, $user)
357
  {
358
  $rul_allow_post_redirect_override = rulRedirectFunctionCollection::get_settings('rul_allow_post_redirect_override');
359
 
1306
  register_activation_hook(__FILE__, 'rul_install');
1307
  register_uninstall_hook(__FILE__, 'rul_uninstall');
1308
 
1309
+
1310
+ add_filter('login_redirect', 'peters_redirect_wrapper', 999999999, 3);
1311
  add_filter('registration_redirect', array('rulRedirectPostRegistration', 'post_registration_wrapper'), 10, 2);
1312
  // whichever one works. directly below might not work if wp_logout function is redefined before ours kicks in.
1313
  add_action('wp_logout', array('rulLogoutFunctionCollection', 'logout_redirect'), 1);
wplogin_redirect_control.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // This assumes that this files sits in "wp-content/plugins/peters-login-redirect/wplogin_redirect_control.php" and that you haven't moved your wp-content folder
3
+ if( file_exists( '../../../wp-load.php' ) )
4
+ {
5
+ include '../../../wp-load.php';
6
+ }
7
+ else
8
+ {
9
+ print 'Plugin paths not configured correctly.';
10
+ }
11
+
12
+ $current_user = wp_get_current_user();
13
+ $redirect_to = admin_url();
14
+ $redirect_url = peters_redirect_wrapper( $redirect_to, '', $current_user );
15
+ wp_redirect( $redirect_url );
16
+ die();
17
+ ?>