File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ function is_ajax() {
93
93
* @return boolean
94
94
*/
95
95
function is_frontend () {
96
+ global $ wp_rewrite ;
97
+
96
98
$ query = get_query ();
97
99
98
100
$ request_uri = isset ( $ _SERVER ['REQUEST_URI ' ] ) ? sanitize_text_field ( wp_unslash ( $ _SERVER ['REQUEST_URI ' ] ) ) : '' ;
@@ -104,12 +106,12 @@ function is_frontend() {
104
106
is_admin () ||
105
107
is_ajax () ||
106
108
is_cron () ||
107
- is_rest () ||
108
109
( $ query && $ query ->is_admin ) ||
109
110
( $ query && $ query ->is_favicon () ) ||
110
111
( $ query && $ query ->is_robots () ) ||
111
112
strpos ( $ request_uri , 'favicon.ico ' ) !== false ||
112
- strpos ( $ request_uri , 'robots.txt ' ) !== false
113
+ strpos ( $ request_uri , 'robots.txt ' ) !== false ||
114
+ ( $ wp_rewrite && is_rest () )
113
115
) {
114
116
return false ;
115
117
}
You can’t perform that action at this time.
0 commit comments