| @@ -184,17 +184,19 @@ | ||
| 184 | 184 | |
| 185 | 185 | $lang_regex = bogo_get_lang_regex(); |
| 186 | 186 | |
| 187 | 187 | // REST rewrite rules |
| 188 | - $rest_url_prefix = rest_get_url_prefix(); | |
| 188 | + if ( function_exists( 'rest_get_url_prefix' ) ) { | |
| 189 | + $rest_url_prefix = rest_get_url_prefix(); | |
| 189 | 190 | |
| 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]' ); | |
| 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]' ); | |
| 195 | 196 | |
| 196 | - $rules = $extra_rules + $rules; | |
| 197 | + $rules = $extra_rules + $rules; | |
| 198 | + } | |
| 197 | 199 | |
| 198 | 200 | $post_types = array_diff( |
| 199 | 201 | (array) bogo_localizable_post_types(), |
| 200 | 202 | get_post_types( array( '_builtin' => true ) ) ); |