File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 4
4
* Description: Adds custom XML-RPC methods to control redirection.
5
5
*/
6
6
7
- $ jquery_redirects = 'jquery_redirects ' ;
8
-
9
7
add_filter ( 'template_redirect ' , function () {
10
- global $ jquery_redirects ;
11
-
12
8
// Only handle 404 Not Found
13
9
if ( !is_404 () ) {
14
10
return ;
17
13
$ url = trailingslashit ( $ _SERVER [ 'REQUEST_URI ' ] );
18
14
19
15
// Check for redirects stored in the transients
20
- $ transient = get_option ( $ jquery_redirects );
16
+ $ transient = get_option ( ' jquery_redirects ' );
21
17
22
18
if ( $ transient && !empty ( $ transient [ $ url ] ) ) {
23
19
wp_redirect ( $ transient [ $ url ], 301 );
31
27
32
28
function jq_set_redirects ( $ args ) {
33
29
global $ wp_xmlrpc_server ;
34
- global $ jquery_redirects ;
35
30
36
31
// Authenticate
37
32
$ username = $ args [ 1 ];
@@ -42,5 +37,5 @@ function jq_set_redirects( $args ) {
42
37
}
43
38
44
39
// Store redirects
45
- return update_option ( $ jquery_redirects , json_decode ( $ args [ 3 ], true ) );
40
+ return update_option ( ' jquery_redirects ' , json_decode ( $ args [ 3 ], true ) );
46
41
}
You can’t perform that action at this time.
0 commit comments