Changeset 9471 for trunk/src/bp-forums/bp-forums-template.php
- Timestamp:
- 02/10/2015 02:49:16 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-forums/bp-forums-template.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-template.php
r9467 r9471 28 28 */ 29 29 function bp_get_forums_slug() { 30 global $bp;31 32 30 /** 33 31 * Filters the forums component slug. … … 37 35 * @param string $slug Forums component slug. 38 36 */ 39 return apply_filters( 'bp_get_forums_slug', $bp->forums->slug );37 return apply_filters( 'bp_get_forums_slug', buddypress()->forums->slug ); 40 38 } 41 39 … … 58 56 */ 59 57 function bp_get_forums_root_slug() { 60 global $bp;61 62 58 /** 63 59 * Filters the forums component root slug. … … 67 63 * @param string $root_slug Forums component root slug. 68 64 */ 69 return apply_filters( 'bp_get_forums_root_slug', $bp->forums->root_slug );65 return apply_filters( 'bp_get_forums_root_slug', buddypress()->forums->root_slug ); 70 66 } 71 67 … … 231 227 */ 232 228 function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms, $offset = false, $number = false ) { 233 global $bp;229 $bp = buddypress(); 234 230 235 231 $this->pag_page = $page; … … 333 329 * @param string $no_stickies Requested sticky format. 334 330 */ 335 $this->topic_count = apply_filters_ref_array( 'bp_forums_template_topic_count',array( $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) );331 $this->topic_count = apply_filters_ref_array( 'bp_forums_template_topic_count', array( $this->topic_count, &$this->topics, $type, $forum_id, $per_page, $max, $no_stickies ) ); 336 332 337 333 /** … … 499 495 */ 500 496 function bp_has_forum_topics( $args = '' ) { 501 global $forum_template, $bp; 497 global $forum_template; 498 499 $bp = buddypress(); 502 500 503 501 /*** … … 1666 1664 */ 1667 1665 function bp_get_my_forum_topics_link() { 1668 global $bp;1669 1670 1666 /** 1671 1667 * Filters the permalink to the 'personal' topics tab. … … 1690 1686 */ 1691 1687 function bp_get_unreplied_forum_topics_link() { 1692 global $bp;1693 1694 1688 /** 1695 1689 * Filters the permalink to the 'unreplied' topics tab. … … 1714 1708 */ 1715 1709 function bp_get_popular_forum_topics_link() { 1716 global $bp;1717 1718 1710 /** 1719 1711 * Filters the permalink to the 'popular' topics tab. … … 1738 1730 */ 1739 1731 function bp_get_newest_forum_topics_link() { 1740 global $bp;1741 1742 1732 /** 1743 1733 * Filters the link to the forums directory. … … 1764 1754 */ 1765 1755 function bp_get_forum_topic_type() { 1766 global $bp;1767 1756 1768 1757 if ( !bp_is_directory() || !bp_current_action() ) … … 1879 1868 */ 1880 1869 function bp_get_forum_pagination_count() { 1881 global $ bp, $forum_template;1870 global $forum_template; 1882 1871 1883 1872 $start_num = intval( ( $forum_template->pag_page - 1 ) * $forum_template->pag_num ) + 1; … … 1909 1898 */ 1910 1899 function bp_is_edit_topic() { 1911 global $bp;1912 1900 1913 1901 if ( bp_is_action_variable( 'post' ) && bp_is_action_variable( 'edit' ) ) … … 2061 2049 */ 2062 2050 function __construct( $topic_id, $per_page, $max, $order ) { 2063 global $ bp, $current_user, $forum_template;2064 2065 if ( !isset( $forum_template ) ) {2066 $forum_template = new stdClass;2067 }2051 global $forum_template; 2052 2053 if ( !isset( $forum_template ) ) { 2054 $forum_template = new stdClass; 2055 } 2068 2056 2069 2057 $this->pag_page = isset( $_REQUEST['topic_page'] ) ? intval( $_REQUEST['topic_page'] ) : 1; … … 2193 2181 */ 2194 2182 function the_post() { 2195 global $post;2196 2183 2197 2184 $this->in_the_loop = true; … … 2516 2503 */ 2517 2504 function bp_get_the_topic_post_is_mine() { 2518 global $ bp, $topic_template;2505 global $topic_template; 2519 2506 2520 2507 return bp_loggedin_user_id() == $topic_template->post->poster_id; … … 2629 2616 */ 2630 2617 function bp_the_topic_pagination_count() { 2631 global $ bp, $topic_template;2618 global $topic_template; 2632 2619 2633 2620 $start_num = intval( ( $topic_template->pag_page - 1 ) * $topic_template->pag_num ) + 1; … … 2758 2745 */ 2759 2746 function bp_get_forum_name( $forum_id = 0 ) { 2760 global $bp;2761 2747 2762 2748 if ( empty( $forum_id ) ) {
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)