WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 2 | cache_javascript_headers(); |
| 3 | ?> |
| 4 | var autosaveLast = ''; |
| 5 | var autosavePeriodical; |
| 6 | |
| 7 | function autosave_start_timer() { |
| 8 | var form = $('post'); |
| 9 | autosaveLast = form.post_title.value+form.content.value; |
| 10 | // Keep autosave_interval in sync with edit_post(). |
| 11 | autosavePeriodical = new PeriodicalExecuter(autosave, <?php echo apply_filters('autosave_interval', '120'); ?>); |
| 12 | //Disable autosave after the form has been submitted |
| 13 | if(form.addEventListener) { |
| 14 | form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false); |
| 15 | } |
| 16 | if(form.attachEvent) { |
| 17 | form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
| 18 | form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
| 19 | form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |
| 20 | form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; |