#1499 closed defect (bug) (fixed)
add_option shouldn't always check db for pre-existing option
Reported by: | westi | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 1.5.2 |
Component: | Optimization | Keywords: | bg|has-patch bg|commit |
Focuses: | Cc: |
Description
Currently some plugins do the following everytime they are run:
add_option('my_opt',...); get_option('my_opt',...);
When these options are defined with autoload as yes wordpress automatically loads them at startup - the add_option code should check the cache to see if the option already exists before checking the db to save on queries.
Patch attached to do this cache checking.
Attachments (2)
Change History (9)
#5
@
19 years ago
- Keywords bg|commit added; bg|2nd-opinion removed
- Owner changed from anonymous to markjaquith
- Severity changed from trivial to minor
- Status changed from new to assigned
- Version changed from 1.5.1.2 to 1.5.2
Old patch wasn't working. Recreated it. Let's get this in the core already! It creates a lot of extra queries!
Note: See
TracTickets for help on using
tickets.
Patch to functions.php to improve add_option