Opened 10 years ago
Closed 10 years ago
#30116 closed enhancement (fixed)
Themes: turn route paths into reusable router properties
Reported by: | matveb | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Themes | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description
Avoid repeating the same fragment path over and over for the themes.php
and theme-install.php
routes. Abstracting this into centralized router attributes will also help with porting the themes UX to .org/themes directory.
Attachments (1)
Change History (8)
#1
@
10 years ago
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.1
- Type changed from enhancement to defect (bug)
- Version changed from trunk to 3.9
This ticket was mentioned in Slack in #core by obenland. View the logs.
10 years ago
This ticket was mentioned in Slack in #core by obenland. View the logs.
10 years ago
#5
@
10 years ago
They can be overwritten by extending the corresponding Router as is.
In the case of the theme repo, it looks like this:
_.extend( wp.themes.InstallerRouter.prototype, { routes: { '/:slug/': 'preview', '/browse/:sort/': 'sort', '/?upload': 'upload', '/search.php?q=:query': 'search', '': 'sort' }, baseUrl: function( url ) { return '/' + url; }, themePath: 'themes/', browsePath: 'browse/', searchPath: 'search.php?q=' });
This ticket was mentioned in Slack in #core by obenland. View the logs.
10 years ago
Note: See
TracTickets for help on using
tickets.
What about the routes events?