public function createRewriteRule()
{
if (!$this->condition()) {
// Compile the route to get a Symfony compiled route
$this->compileRoute();
// Retrieve the regex to use of registering the rewrite rule for this route
$regex = $this->getRewriteRuleRegex();
// Add the rewrite rule to the top
add_action('init', function () use($regex) {
add_rewrite_tag('%is_' . $this->rewrite_tag_prefix . '_route%', '(\\d)');
add_rewrite_rule($regex, 'index.php?is_' . $this->rewrite_tag_prefix . '_route=1', 'top');
});
}
}