WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/13/2008 06:21:52 PM (13 years ago)
Author:
ryan
Message:

Add sticky_class() template tag. see #7457

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r8600 r8637  
    159159    $post = &get_post( $id );
    160160    return ( !empty( $post->post_excerpt ) );
     161}
     162
     163/**
     164 * Echo "sticky" CSS class if a post is sticky
     165 *
     166 * {@internal Missing Long Description}}
     167 *
     168 * @package WordPress
     169 * @subpackage Post
     170 * @since 2.7
     171 *
     172 * @param int $post_id An optional post ID
     173 */
     174function sticky_class( $post_id = null ) {
     175    if ( !is_sticky($post_id) )
     176        return;
     177
     178    echo " sticky";
    161179}
    162180
Note: See TracChangeset for help on using the changeset viewer.