Changeset 5827 for trunk/src/includes/topics/template.php
- Timestamp:
- 07/14/2015 12:31:42 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/topics/template.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r5811 r5827 128 128 * @uses bbp_get_super_stickies() To get the super stickies 129 129 * @uses bbp_get_stickies() To get the forum stickies 130 * @uses wpdb::get_results() To execute our query and get the results 131 * @uses WP_Rewrite::using_permalinks() To check if the blog is using permalinks 130 * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs 132 131 * @uses get_permalink() To get the permalink 133 132 * @uses add_query_arg() To add custom args to the url … … 140 139 */ 141 140 function bbp_has_topics( $args = array() ) { 142 global $wp_rewrite;143 141 144 142 /** Defaults **************************************************************/ … … 354 352 355 353 // If pretty permalinks are enabled, make our pagination pretty 356 if ( $wp_rewrite->using_permalinks() ) {354 if ( bbp_use_pretty_urls() ) { 357 355 358 356 // User's topics … … 398 396 399 397 // Use pagination base 400 $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base. '/%#%/' );398 $base = trailingslashit( $base ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' ); 401 399 402 400 // Unpretty pagination … … 420 418 421 419 // Remove first page from pagination 422 $bbp->topic_query->pagination_links = str_replace( $wp_rewrite->pagination_base. "/1/'", "'", $bbp->topic_query->pagination_links );420 $bbp->topic_query->pagination_links = str_replace( bbp_get_paged_slug() . "/1/'", "'", $bbp->topic_query->pagination_links ); 423 421 } 424 422 … … 851 849 * - after: After the links 852 850 * @uses bbp_get_topic_id() To get the topic id 853 * @uses WP_Rewrite::using_permalinks() To check if the blog is using 854 * permalinks 851 * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs 855 852 * @uses user_trailingslashit() To add a trailing slash 856 853 * @uses trailingslashit() To add a trailing slash … … 866 863 */ 867 864 function bbp_get_topic_pagination( $args = array() ) { 868 global $wp_rewrite;869 865 870 866 // Bail if threading replies … … 881 877 882 878 // If pretty permalinks are enabled, make our pagination pretty 883 if ( $wp_rewrite->using_permalinks() ) {884 $base = trailingslashit( get_permalink( $r['topic_id'] ) ) . user_trailingslashit( $wp_rewrite->pagination_base. '/%#%/' );879 if ( bbp_use_pretty_urls() ) { 880 $base = trailingslashit( get_permalink( $r['topic_id'] ) ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' ); 885 881 } else { 886 882 $base = add_query_arg( 'paged', '%#%', get_permalink( $r['topic_id'] ) ); … … 910 906 911 907 // Remove first page from pagination 912 if ( $wp_rewrite->using_permalinks() ) {913 $pagination_links = str_replace( $wp_rewrite->pagination_base. '/1/', '', $pagination_links );908 if ( bbp_use_pretty_urls() ) { 909 $pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $pagination_links ); 914 910 } else { 915 911 $pagination_links = str_replace( '&paged=1', '', $pagination_links ); … … 2640 2636 */ 2641 2637 function bbp_get_topic_edit_url( $topic_id = 0 ) { 2642 global $wp_rewrite;2643 2638 2644 2639 $topic = bbp_get_topic( $topic_id ); … … 2651 2646 2652 2647 // Pretty permalinks 2653 if ( $wp_rewrite->using_permalinks() ) {2648 if ( bbp_use_pretty_urls() ) { 2654 2649 $url = trailingslashit( $topic_link ) . bbp_get_edit_rewrite_id(); 2655 $url = trailingslashit( $url );2650 $url = user_trailingslashit( $url ); 2656 2651 2657 2652 // Unpretty permalinks 2658 2653 } else { 2659 $url = add_query_arg( array( bbp_get_topic_post_type() => $topic->post_name, bbp_get_edit_rewrite_id() => '1' ), $topic_link ); 2654 $url = add_query_arg( array( 2655 bbp_get_topic_post_type() => $topic->post_name, 2656 bbp_get_edit_rewrite_id() => '1' 2657 ), $topic_link ); 2660 2658 } 2661 2659 … … 3767 3765 */ 3768 3766 function bbp_get_topic_tag_edit_link( $tag = '' ) { 3769 global $wp_rewrite;3770 3767 3771 3768 // Get the term … … 3781 3778 3782 3779 // Pretty 3783 if ( $wp_rewrite->using_permalinks() ) {3780 if ( bbp_use_pretty_urls() ) { 3784 3781 $retval = user_trailingslashit( trailingslashit( bbp_get_topic_tag_link() ) . bbp_get_edit_rewrite_id() ); 3785 3782
Note: See TracChangeset
for help on using the changeset viewer.