Opened 17 years ago
Closed 17 years ago
#5326 closed defect (bug) (fixed)
Don't use sanitize_title in widgets API
Reported by: | ryan | Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | General | Keywords: | performance |
Focuses: | Cc: |
Description
widgets.php calls sanitize_title() on widget IDs. For the new API (functions starting with wp_), this isn't necessary. sanitize_title() is a slow function that does lots of stuff we don't need to do when sanitizing an ID. Let's just drop the sanitization and take the ID as is. For the old widgets API (functions without wp_), the sanitization can stay for maximum back-compat.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
This patch reduced the number of calls to sanitize_title() from 103 to 2 on my testbed. The amount of time spent in sanitize_title() dropped from almost 10% to a fraction of a percent.