Changeset 3571 for branches/plugin/bbp-includes/bbp-reply-template.php
- Timestamp:
- 11/02/2011 06:21:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/plugin/bbp-includes/bbp-reply-template.php ¶
r3506 r3571 1705 1705 * 1706 1706 * @since bbPress (r2678) 1707 */ 1708 function bbp_reply_class() { 1709 echo bbp_get_reply_class(); 1707 * 1708 * @param int $reply_id Optional. Reply ID 1709 * @uses bbp_get_reply_class() To get the reply class 1710 */ 1711 function bbp_reply_class( $reply_id = 0 ) { 1712 echo bbp_get_reply_class( $reply_id ); 1710 1713 } 1711 1714 /** … … 1714 1717 * @since bbPress (r2678) 1715 1718 * 1716 * @uses post_class() To get all the classes including ours 1719 * @param int $reply_id Optional. Reply ID 1720 * @uses get_post_class() To get all the classes including ours 1717 1721 * @uses apply_filters() Calls 'bbp_get_reply_class' with the classes 1718 1722 * @return string Row class of the reply 1719 1723 */ 1720 function bbp_get_reply_class( ) {1724 function bbp_get_reply_class( $reply_id = 0 ) { 1721 1725 global $bbp; 1722 1726 1727 $reply_id = bbp_get_reply_id( $reply_id ); 1723 1728 $count = isset( $bbp->reply_query->current_post ) ? $bbp->reply_query->current_post : 1; 1724 $alternate = (int) $count % 2 ? 'even' : 'odd'; 1725 $post = post_class( array( $alternate ) ); 1726 1727 return apply_filters( 'bbp_reply_class', $post ); 1729 $classes = array(); 1730 $classes[] = ( (int) $count % 2 ) ? 'even' : 'odd'; 1731 $retval = get_post_class( $classes, $reply_id ); 1732 $retval = 'class="' . join( ' ', $retval ) . '"'; 1733 1734 return apply_filters( 'bbp_get_reply_class', $retval, $reply_id ); 1728 1735 } 1729 1736
Note: See TracChangeset
for help on using the changeset viewer.