[wp-trac] [WordPress Trac] #64037: New filters for managing rewrite rules
WordPress Trac
noreply at wordpress.org
Wed Sep 24 12:37:36 UTC 2025
#64037: New filters for managing rewrite rules
---------------------------+-----------------------------
Reporter: StephanR | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Rewrite Rules | Version:
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
Hello,
Almost two years ago, I developed a rewrite rules system to enable our
beloved WordPress to manage “sub-sites.”
They take the form *''host*''/my-sub-site/*''classic-rewriting''*/.
It works perfectly.
To do this, I had to divert the “parse_request” function to add two
filters.
''(Managing the “page” post type is really confusing in “parse_request”
and does not follow the logic of custom post types).''
To help other developers and ensure the longevity of this tool, could you
add the following two lines to the code (apply_filters) ?
{{{#!php
<?php
wp-includes/class-wp.php
class WP {
function parse_request {
...
// Look for matches.
$request_match = $requested_path;
$request_match = apply_filters('wp_filter_request_match',
$request_match, $this);
$requested_path =
apply_filters('wp_filter_requested_path', $requested_path, $this);
...
if (empty($request_match)) {
...
}
...
}
}
}}}
Thank you in advance.
Stephan Renault
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64037>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list