[wp-trac] [WordPress Trac] #12935: Evolve the URL routing system
WordPress Trac
wp-trac at lists.automattic.com
Wed May 26 17:41:03 UTC 2010
#12935: Evolve the URL routing system
--------------------------+-------------------------------------------------
Reporter: mikeschinkel | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: 3.1
Component: Permalinks | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Comment(by mikeschinkel):
Here is the deconstruction of the URLs I came up with.
I've designed a psuedo-code where `%%var%% {...}` is a macro for one or
URL path branches that can be applied to a path branch, and they can be
optional. Each line that isn't a macro is a potential URL path and each
line within a macro is a potential URL path branch. These lines assume the
regex definitions of `query_vars` that are already defined in WordPress so
these lines don't concern themselves with query var definitions.
Doing it this way allowed me to deconstruct them so as to have no
duplication. I'm sure these are almost completely correct but they strike
me as a tad inconsistent (i.e. some URLs get the `ssort` parameter and
others that seem like they should don't; some get support for trackbacks,
etc.)
I also noticed that `%day%` was not matched for some post and attachment
URLs hence the `%dummy%` var. Also the `%*%` is a wildcard to match
anything that comes before it.
''As an aside'', being able to view WordPress' URL rewrite/routing system
in this manner makes it a lot easier for me to grasp and digest in one
sitting. I'm thinking if the implementation is similarly straightforward
it will be a comparatively easy for developers and even themers to get
their heads around:
{{{
%%feed%% {
feed/%feed%
%feed%
}
%%page%% {
page/%page%
}
%%feed_page%%(optional) {
%%feed%%
%%page%%
}
%%sort_feed_page%%(optional) {
sort/%ssort%/%%feed_page%%
}
%%comment_page%% {
comment-page-%cpage%
}
%%paged%% {
page/%paged%
%paged%
}
%%trackback_feed_comment_page%%(optional) {
trackback
%%feed%%
%%comment_page%%
}
%%trackback_feed_paged_comment_page%%(optional) {
%%trackback_feed_comment_page%%
%%paged%%
}
%%attachment%% {
attachment/%attachment%
}
%%attachment_trackback_feed_comment_page%% {
%%attachment%%/%%trackback_feed_comment_page%%
}
%year%/%month%/%day%/%%sort_feed_page%%
%year%/%month%/%%sort_feed_page%%
%year%/%%sort_feed_page%%
author/%author%/%%sort_feed_page%%
tag/%tag%/%%sort_feed_page%%
category/%category%/%%sort_feed_page%%
%%sort_feed_page%%
robots.txt
%*%wp-%feed%.php
%*%wp-commentsrss2.php
%%feed_page%%
comments/%%feed_page%%
search/%s/%%feed_page%%
%year%/%month%/%dummy%/%%attachment_trackback_feed_comment_page%%
%year%/%month%/%dummy%/%post%/%%trackback_feed_paged_comment_page%%
%year%/%month%/%dummy%/%%trackback_feed_paged_comment_page%%
%year%/%month%/%%comment_page%%
%year%/%%comment_page%%
%*%/%%attachment_trackback_feed_comment_page%%
%page%/%%trackback_feed_paged_comment_page%%
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12935#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list