@@ 1193-1206 (lines=14) @@ | ||
1190 | * @param string $old_status The old post status |
|
1191 | * @param object $post Post object |
|
1192 | */ |
|
1193 | function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) { |
|
1194 | $post_type_obj = get_post_type_object( $post->post_type ); |
|
1195 | if ( ! $post_type_obj || ! $post_type_obj->public ) { |
|
1196 | return; |
|
1197 | } |
|
1198 | ||
1199 | if ( 'publish' != $new_status && 'publish' != $old_status ) { |
|
1200 | return; |
|
1201 | } |
|
1202 | ||
1203 | // Post was freshly published, published post was saved, or published post was unpublished. |
|
1204 | ||
1205 | wpmu_update_blogs_date(); |
|
1206 | } |
|
1207 | ||
1208 | /** |
|
1209 | * Handler for updating the blog date when a published post is deleted. |
|
@@ 1215-1228 (lines=14) @@ | ||
1212 | * |
|
1213 | * @param int $post_id Post ID |
|
1214 | */ |
|
1215 | function _update_blog_date_on_post_delete( $post_id ) { |
|
1216 | $post = get_post( $post_id ); |
|
1217 | ||
1218 | $post_type_obj = get_post_type_object( $post->post_type ); |
|
1219 | if ( ! $post_type_obj || ! $post_type_obj->public ) { |
|
1220 | return; |
|
1221 | } |
|
1222 | ||
1223 | if ( 'publish' != $post->post_status ) { |
|
1224 | return; |
|
1225 | } |
|
1226 | ||
1227 | wpmu_update_blogs_date(); |
|
1228 | } |
|
1229 | ||
1230 | /** |
|
1231 | * Handler for updating the blog posts count date when a post is deleted. |