Make WordPress Core

Opened 6 weeks ago

#64037 new enhancement

New filters for managing rewrite rules

Reported by: stephanr's profile StephanR Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords:
Focuses: Cc:

Description

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
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

Change History (0)

Note: See TracTickets for help on using tickets.