| @@ -184,19 +184,17 @@ | ||
| 184 | 184 | |
| 185 | 185 | $lang_regex = bogo_get_lang_regex(); |
| 186 | 186 | |
| 187 | 187 | // REST rewrite rules |
| 188 | - if ( function_exists( 'rest_get_url_prefix' ) ) { | |
| 189 | - $rest_url_prefix = rest_get_url_prefix(); | |
| 188 | + $rest_url_prefix = rest_get_url_prefix(); | |
| 190 | 189 | |
| 191 | - $extra_rules = array( | |
| 192 | - "^{$lang_regex}/{$rest_url_prefix}/?$" | |
| 193 | - => 'index.php?lang=$matches[1]&rest_route=/', | |
| 194 | - "^{$lang_regex}/{$rest_url_prefix}/(.*)?" | |
| 195 | - => 'index.php?lang=$matches[1]&rest_route=/$matches[2]' ); | |
| 190 | + $extra_rules = array( | |
| 191 | + "^{$lang_regex}/{$rest_url_prefix}/?$" | |
| 192 | + => 'index.php?lang=$matches[1]&rest_route=/', | |
| 193 | + "^{$lang_regex}/{$rest_url_prefix}/(.*)?" | |
| 194 | + => 'index.php?lang=$matches[1]&rest_route=/$matches[2]' ); | |
| 196 | 195 | |
| 197 | - $rules = $extra_rules + $rules; | |
| 198 | - } | |
| 196 | + $rules = $extra_rules + $rules; | |
| 199 | 197 | |
| 200 | 198 | $post_types = array_diff( |
| 201 | 199 | (array) bogo_localizable_post_types(), |
| 202 | 200 | get_post_types( array( '_builtin' => true ) ) ); |