Changeset 5827 for trunk/src/includes/replies/template.php
- Timestamp:
- 07/14/2015 12:31:42 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/includes/replies/template.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/template.php
r5770 r5827 109 109 * others' replies 110 110 * @uses WP_Query To make query and get the replies 111 * @uses WP_Rewrite::using_permalinks() To check if the blog is using permalinks111 * @uses bbp_use_pretty_urls() To check if the site is using pretty URLs 112 112 * @uses get_permalink() To get the permalink 113 113 * @uses add_query_arg() To add custom args to the url … … 120 120 */ 121 121 function bbp_has_replies( $args = array() ) { 122 global $wp_rewrite;123 122 124 123 /** Defaults **************************************************************/ … … 226 225 227 226 // If pretty permalinks are enabled, make our pagination pretty 228 if ( $wp_rewrite->using_permalinks() ) {227 if ( bbp_use_pretty_urls() ) { 229 228 230 229 // User's replies … … 245 244 } 246 245 247 $base = trailingslashit( $base ) . user_trailingslashit( $wp_rewrite->pagination_base. '/%#%/' );246 $base = trailingslashit( $base ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' ); 248 247 249 248 // Unpretty permalinks … … 272 271 273 272 // Remove first page from pagination 274 if ( $wp_rewrite->using_permalinks() ) {275 $bbp->reply_query->pagination_links = str_replace( $wp_rewrite->pagination_base. '/1/', '', $bbp->reply_query->pagination_links );273 if ( bbp_use_pretty_urls() ) { 274 $bbp->reply_query->pagination_links = str_replace( bbp_get_paged_slug() . '/1/', '', $bbp->reply_query->pagination_links ); 276 275 } else { 277 276 $bbp->reply_query->pagination_links = str_replace( '&paged=1', '', $bbp->reply_query->pagination_links ); … … 474 473 * @uses bbp_get_reply_position() To get the reply position 475 474 * @uses get_option() To get the replies per page option 476 * @uses WP_Rewrite::using_permalinks() To check if the blog uses 477 * permalinks 475 * @uses bbp_use_pretty_urls() To check if the site uses pretty URLs 478 476 * @uses add_query_arg() To add custom args to the url 479 477 * @uses apply_filters() Calls 'bbp_get_reply_url' with the reply url, … … 506 504 // Include pagination 507 505 } else { 508 global $wp_rewrite;509 506 510 507 // Pretty permalinks 511 if ( $wp_rewrite->using_permalinks() ) {512 $url = trailingslashit( $topic_url ) . trailingslashit( $wp_rewrite->pagination_base) . trailingslashit( $reply_page ) . $reply_hash;508 if ( bbp_use_pretty_urls() ) { 509 $url = trailingslashit( $topic_url ) . trailingslashit( bbp_get_paged_slug() ) . trailingslashit( $reply_page ) . $reply_hash; 513 510 514 511 // Yucky links … … 2022 2019 */ 2023 2020 function bbp_get_reply_edit_url( $reply_id = 0 ) { 2024 global $wp_rewrite;2025 2021 2026 2022 $reply = bbp_get_reply( $reply_id ); … … 2032 2028 2033 2029 // Pretty permalinks 2034 if ( $wp_rewrite->using_permalinks() ) {2030 if ( bbp_use_pretty_urls() ) { 2035 2031 $url = trailingslashit( $reply_link ) . bbp_get_edit_rewrite_id(); 2036 $url = trailingslashit( $url );2032 $url = user_trailingslashit( $url ); 2037 2033 2038 2034 // Unpretty permalinks 2039 2035 } else { 2040 $url = add_query_arg( array( bbp_get_reply_post_type() => $reply->post_name, bbp_get_edit_rewrite_id() => '1' ), $reply_link ); 2036 $url = add_query_arg( array( 2037 bbp_get_reply_post_type() => $reply->post_name, 2038 bbp_get_edit_rewrite_id() => '1' 2039 ), $reply_link ); 2041 2040 } 2042 2041
Note: See TracChangeset
for help on using the changeset viewer.