diff --git a/src/Configuration/WordPressConfiguration.php b/src/Configuration/WordPressConfiguration.php index c92980d..e0238c5 100644 --- a/src/Configuration/WordPressConfiguration.php +++ b/src/Configuration/WordPressConfiguration.php @@ -87,6 +87,13 @@ public function modify(Container $container) ]; }); $container['rest_url'] = $container->service(function () { + global $wp_rewrite; + + if (!$wp_rewrite instanceof \WP_Rewrite) { + $wp_rewrite = new \WP_Rewrite(); + $wp_rewrite->init(); + } + return get_rest_url(); }); $container['site_icon'] = $container->service(function () {