Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.

Commit b01cf52

Browse files
committed
Flush rewrite immediately on activation
1 parent c13f4b8 commit b01cf52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ function ($serviceClass) use ($instanceManager) {
263263
$postTypeObject->registerPostType();
264264
}
265265

266-
// Flush the rewrite rules not immediately, but at the end of hook "init",
266+
// Flush the rewrite rules immediately (doing it at the end of hook "init",
267267
// after function `addRewriteEndpoints` in `AbstractEndpointHandler`
268-
// is executed (flush only after doing `add_rewrite_endpoint`)
269-
\add_action('init', 'flush_rewrite_rules', PHP_INT_MAX);
268+
// is executed, doesn't work)
269+
\flush_rewrite_rules();
270270

271271
// Initialize the timestamp
272272
$userSettingsManager = UserSettingsManagerFacade::getInstance();

0 commit comments

Comments
 (0)