WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #16687, comment 16


Ignore:
Timestamp:
04/20/2011 08:25:55 AM (10 years ago)
Author:
duck_
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16687, comment 16

    initial v1  
    66}}}
    77
    8 I worked around this by removing these attachment rules and dealing with them as part of the page catch-all. If there is a / then it's either a page or an attachment, it's the latter if matched by any of the attachment rewrite rules that were previously unset (transformed into non-regex form, this is were it gets a bit uglier/hackish![1]) *and* the attachment piece -- `([^/]+)` -- is actually an attachment... otherwise it's a page. On the other hand we have a post or a page which can be dealt with as before.
     8I worked around this by removing these attachment rules and dealing with them as part of the page catch-all. If there is a / then it's either a page or an attachment, it's the latter if matched by any of the attachment rewrite rules that were previously unset (transformed into non-regex form, this is where it gets a bit uglier/hackish![1]) *and* the attachment piece -- `([^/]+)` -- is actually an attachment... otherwise it's a page. On the other hand we have a post or a page which can be dealt with as before.
    99
    1010I also added a check to only change the rules specifically for the /%postname%/ structure as it will just break other verbose structures.