Changeset 1538704
- Timestamp:
- 11/22/2016 10:05:48 PM (9 years ago)
- File:
-
- 1 edited
-
batcache/trunk/batcache.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
batcache/trunk/batcache.php
r1300303 r1538704 16 16 17 17 // Regen home and permalink on posts and pages 18 add_action('clean_post_cache', 'batcache_post' );18 add_action('clean_post_cache', 'batcache_post', 10, 2); 19 19 20 20 // Regen permalink on comments (TODO) … … 23 23 //add_action('edit_comment', 'batcache_comment'); 24 24 25 function batcache_post($post_id ) {25 function batcache_post($post_id, $post = null) { 26 26 global $batcache; 27 27 28 $post = get_post($post_id); 29 if ( $post->post_type == 'revision' || ! in_array( get_post_status($post_id), array( 'publish', 'trash' ) ) ) 28 // Get the post for backwards compatibility with earlier versions of WordPress 29 if ( ! $post ) { 30 $post = get_post( $post_id ); 31 } 32 33 if ( ! $post || $post->post_type == 'revision' || ! in_array( get_post_status($post_id), array( 'publish', 'trash' ) ) ) 30 34 return; 31 35
Note: See TracChangeset
for help on using the changeset viewer.