Changeset 6889
 Timestamp:
 01/25/2019 10:17:11 PM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/includes/core/abstraction.php
r6842 r6889 165 165 return bbp_get_global_object( 'wp_rewrite', 'WP_Rewrite', (object) array( 166 166 'root' => '', 167 'pagination_base' => ' ',167 'pagination_base' => 'page', 168 168 ) ); 169 169 } … … 178 178 function bbp_get_root_url() { 179 179 180 // Filter & return 181 return apply_filters( 'bbp_get_root_url', bbp_rewrite()>root ); 180 // Default 181 $retval = ''; 182 $rewrite = bbp_rewrite(); 183 184 // Use $wp_rewrite>root if available 185 if ( property_exists( $rewrite, 'root' ) ) { 186 $retval = $rewrite>root; 187 } 188 189 // Filter & return 190 return apply_filters( 'bbp_get_root_url', $retval ); 182 191 } 183 192 … … 191 200 function bbp_get_paged_slug() { 192 201 193 // Filter & return 194 return apply_filters( 'bbp_get_paged_slug', bbp_rewrite()>pagination_base ); 202 // Default 203 $retval = 'page'; 204 $rewrite = bbp_rewrite(); 205 206 // Use $wp_rewrite>pagination_base if available 207 if ( property_exists( $rewrite, 'pagination_base' ) ) { 208 $retval = $rewrite>pagination_base; 209 } 210 211 // Filter & return 212 return apply_filters( 'bbp_get_paged_slug', $retval ); 213 } 214 215 /** 216 * Is the environment using pretty URLs? 217 * 218 * @since 2.5.8 bbPress (r5814) 219 * 220 * @global object $wp_rewrite The WP_Rewrite object 221 * 222 * @return bool 223 */ 224 function bbp_use_pretty_urls() { 225 226 // Default 227 $retval = false; 228 $rewrite = bbp_rewrite(); 229 230 // Use $wp_rewrite>using_permalinks() if available 231 if ( method_exists( $rewrite, 'using_permalinks' ) ) { 232 $retval = $rewrite>using_permalinks(); 233 } 234 235 // Filter & return 236 return apply_filters( 'bbp_pretty_urls', $retval ); 195 237 } 196 238 … … 270 312 271 313 /** 272 * Is the environment using pretty URLs?273 *274 * @since 2.5.8 bbPress (r5814)275 *276 * @global object $wp_rewrite The WP_Rewrite object277 *278 * @return bool279 */280 function bbp_use_pretty_urls() {281 282 // Default283 $retval = false;284 $rewrite = bbp_rewrite();285 286 // Use $wp_rewrite>using_permalinks() if available287 if ( method_exists( $rewrite, 'using_permalinks' ) ) {288 $retval = $rewrite>using_permalinks();289 }290 291 // Filter & return292 return apply_filters( 'bbp_pretty_urls', $retval );293 }294 295 /**296 314 * Parse the WordPress core version number 297 315 *
Note: See TracChangeset
for help on using the changeset viewer.