Changeset 15563
- Timestamp:
- 09/04/2010 03:51:04 PM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/comment-template.php
r15549 r15563 546 546 */ 547 547 function get_comments_number( $post_id = 0 ) { 548 $post_id = absint( $post_id ); 549 548 550 if ( !$post_id ) 549 551 $post_id = get_the_ID(); 550 551 $post_id = absint($post_id);552 552 553 553 $post = get_post($post_id); -
trunk/wp-includes/link-template.php
r15549 r15563 462 462 * @return string 463 463 */ 464 function get_post_comments_feed_link($post_id = '', $feed = '') { 465 if ( !$post_id ) 464 function get_post_comments_feed_link($post_id = 0, $feed = '') { 465 $post_id = absint( $post_id ); 466 467 if ( ! $post_id ) 466 468 $post_id = get_the_ID(); 467 469 468 $post_id = absint($post_id); 469 470 if ( empty($feed) ) 470 if ( empty( $feed ) ) 471 471 $feed = get_default_feed(); 472 472 -
trunk/wp-includes/post.php
r15549 r15563 1268 1268 * @return array 1269 1269 */ 1270 function get_post_custom($post_id = 0) { 1271 if ( !$post_id ) 1270 function get_post_custom( $post_id = 0 ) { 1271 $post_id = absint( $post_id ); 1272 1273 if ( ! $post_id ) 1272 1274 $post_id = get_the_ID(); 1273 1275 1274 $post_id = (int) $post_id; 1275 1276 if ( ! wp_cache_get($post_id, 'post_meta') ) 1277 update_postmeta_cache($post_id); 1278 1279 return wp_cache_get($post_id, 'post_meta'); 1276 if ( ! wp_cache_get( $post_id, 'post_meta' ) ) 1277 update_postmeta_cache( $post_id ); 1278 1279 return wp_cache_get( $post_id, 'post_meta' ); 1280 1280 } 1281 1281 … … 1334 1334 * @return bool Whether post is sticky. 1335 1335 */ 1336 function is_sticky($post_id = null) { 1337 if ( !$post_id ) 1336 function is_sticky( $post_id = 0 ) { 1337 $post_id = absint( $post_id ); 1338 1339 if ( ! $post_id ) 1338 1340 $post_id = get_the_ID(); 1339 1341 1340 $post_id = absint($post_id); 1341 1342 $stickies = get_option('sticky_posts'); 1343 1344 if ( !is_array($stickies) ) 1342 $stickies = get_option( 'sticky_posts' ); 1343 1344 if ( ! is_array( $stickies ) ) 1345 1345 return false; 1346 1346 1347 if ( in_array( $post_id, $stickies) )1347 if ( in_array( $post_id, $stickies ) ) 1348 1348 return true; 1349 1349
Note: See TracChangeset
for help on using the changeset viewer.