[wp-trac] Re: [WordPress Trac] #7874: the_sticky() to "the loop"

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 13 10:33:49 GMT 2008


#7874: the_sticky() to "the loop"
-------------------------+--------------------------------------------------
 Reporter:  ShaneF       |        Owner:  anonymous
     Type:  enhancement  |       Status:  reopened 
 Priority:  normal       |    Milestone:  2.7      
Component:  General      |      Version:  2.7      
 Severity:  normal       |   Resolution:           
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by ShaneF):

 {{{
 function the_sticky($sticky = '', $before = '', $after = '', $echo = true)
 {
         global $id;

         if (!is_sticky(absint($id)))
                 return;

         if ( strlen($sticky) == 0 ) {
                 if (!is_sticky(absint($id)))
                         return false;
                 else
                         return true;
         }

         $sticky = $before . $sticky . $after;

         if ( $echo )
                 echo apply_filters( 'the_sticky', $sticky );
         else
                 return apply_filters( 'the_sticky', $sticky );

 }
 }}}

 This is a better version... :)

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7874#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list