Changeset 15563 for trunk/wp-includes/post.php
- Timestamp:
- 09/04/2010 03:51:04 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)