Opened 12 years ago
Closed 12 years ago
#20912 closed defect (bug) (worksforme)
Php Notice for autosave in DEBUG mode when disabling autosave
Reported by: | Marble23 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | 3.3.2 |
Component: | Autosave | Keywords: | close |
Focuses: | Cc: |
Description
If you turn off autosave in your theme functions file, for example
function disable_auto_save(){ wp_deregister_script('autosave'); } add_action( 'wp_print_scripts', 'disable_auto_save' );
set DEBUG to true you get an undefined index error in class.wp-scripts.php on line 155.
Its easily fixed if you check for the index:
- if ( isset($this->registered[$handle]) && $this->registered[$handle]->args === 1 ) + if ( $this->registered[$handle]->args === 1 )
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Uploaded the patch, but then realized that
wp_print_scripts
might not be the proper hook to disable autosave. Hooking intoinit
with a later priority works without a notice.