Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: autosave_interval

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
189                wp_die( __('You are not allowed to edit this post.' ));
190      }
191
192      // Autosave shouldn't save too soon after a real save
193      if ( 'autosave' == $_POST['action'] ) {
194           $post =& get_post( $post_ID );
195           $now = time();
196           $then = strtotime($post->post_date_gmt . ' +0000');
197           // Keep autosave_interval in sync with autosave-js.php.
198           $delta = apply_filters( 'autosave_interval', 120 ) / 2;
199           if ( ($now - $then) < $delta )
200                return $post_ID;
201      }
202
203      // Rename.
204      $_POST['ID'] = (int) $_POST['post_ID'];
205      $_POST['post_content'] = $_POST['content'];
206      $_POST['post_excerpt'] = $_POST['excerpt'];
207      $_POST['post_parent'] = $_POST['parent_id'];