Changeset 3571
- Timestamp:
- 11/02/2011 06:21:14 PM (15 years ago)
- Location:
- branches/plugin/bbp-includes
- Files:
-
- 3 edited
-
bbp-forum-template.php (modified) (2 diffs)
-
bbp-reply-template.php (modified) (2 diffs)
-
bbp-topic-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-forum-template.php
r3563 r3571 1613 1613 * @since bbPress (r2667) 1614 1614 * 1615 * @param int $forum_id Optional. Forum ID. 1615 1616 * @uses bbp_get_forum_class() To get the row class of the forum 1616 1617 */ 1617 function bbp_forum_class( ) {1618 echo bbp_get_forum_class( );1618 function bbp_forum_class( $forum_id = 0 ) { 1619 echo bbp_get_forum_class( $forum_id ); 1619 1620 } 1620 1621 /** … … 1623 1624 * @since bbPress (r2667) 1624 1625 * 1625 * @uses post_class() To get all the classes including ours 1626 * @param int $forum_id Optional. Forum ID 1627 * @uses get_post_class() To get all the classes including ours 1626 1628 * @uses apply_filters() Calls 'bbp_get_forum_class' with the classes 1627 1629 * @return string Row class of the forum 1628 1630 */ 1629 function bbp_get_forum_class( ) {1631 function bbp_get_forum_class( $forum_id = 0 ) { 1630 1632 global $bbp; 1631 1633 1634 $forum_id = bbp_get_forum_id( $forum_id ); 1635 $count = isset( $bbp->forum_query->current_post ) ? $bbp->forum_query->current_post : 1; 1632 1636 $classes = array(); 1633 $classes[] = $bbp->forum_query->current_post % 2 ? 'even': 'odd';1634 $classes[] = bbp_is_forum_category( ) ? 'status-category' : '';1635 $classes[] = bbp_is_forum_private( ) ? 'status-private' : '';1637 $classes[] = ( (int) $count % 2 ) ? 'even' : 'odd'; 1638 $classes[] = bbp_is_forum_category( $forum_id ) ? 'status-category' : ''; 1639 $classes[] = bbp_is_forum_private( $forum_id ) ? 'status-private' : ''; 1636 1640 $classes = array_filter( $classes ); 1637 1638 $ post = post_class( $classes );1639 1640 return apply_filters( 'bbp_get_forum_class', $ post);1641 $retval = get_post_class( $classes, $forum_id ); 1642 $retval = 'class="' . join( ' ', $retval ) . '"'; 1643 1644 return apply_filters( 'bbp_get_forum_class', $retval, $forum_id ); 1641 1645 } 1642 1646 -
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 -
branches/plugin/bbp-includes/bbp-topic-template.php
r3558 r3571 1931 1931 * @uses bbp_is_topic_super_sticky() To check if the topic is a super 1932 1932 * sticky 1933 * @uses post_class() To get the topic classes1933 * @uses get_post_class() To get the topic classes 1934 1934 * @uses apply_filters() Calls 'bbp_get_topic_class' with the classes 1935 1935 * and topic id … … 1939 1939 global $bbp; 1940 1940 1941 $topic_id = bbp_get_topic_id( $topic_id ); 1942 $count = isset( $bbp->topic_query->current_post ) ? $bbp->topic_query->current_post : 1; 1941 1943 $classes = array(); 1942 $classes[] = $bbp->topic_query->current_post % 2? 'even' : 'odd';1944 $classes[] = ( (int) $count % 2 ) ? 'even' : 'odd'; 1943 1945 $classes[] = bbp_is_topic_sticky( $topic_id, false ) ? 'sticky' : ''; 1944 1946 $classes[] = bbp_is_topic_super_sticky( $topic_id ) ? 'super-sticky' : ''; 1945 1947 $classes = array_filter( $classes ); 1946 $post = post_class( $classes, $topic_id ); 1947 1948 return apply_filters( 'bbp_get_topic_class', $post, $topic_id ); 1948 $retval = get_post_class( $classes, $topic_id ); 1949 $retval = 'class="' . join( ' ', $retval ) . '"'; 1950 1951 return apply_filters( 'bbp_get_topic_class', $retval, $topic_id ); 1949 1952 } 1950 1953
Note: See TracChangeset
for help on using the changeset viewer.