| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Search Template Tags. | |
| 4 | + * bbPress Search Template Tags | |
| 5 | 5 | * |
| 6 | 6 | * @package bbPress |
| 7 | 7 | * @subpackage TemplateTags |
| 8 | 8 | */ |
| @@ -16,10 +16,10 @@ | ||
| 16 | 16 | * The main search loop. WordPress does the heavy lifting. |
| 17 | 17 | * |
| 18 | 18 | * @since 2.3.0 bbPress (r4579) |
| 19 | 19 | * |
| 20 | - * @param array $args All the arguments supported by {@link WP_Query}. | |
| 21 | - * @return object Multidimensional array of search information. | |
| 20 | + * @param array $args All the arguments supported by {@link WP_Query} | |
| 21 | + * @return object Multidimensional array of search information | |
| 22 | 22 | */ |
| 23 | 23 | function bbp_has_search_results( $args = array() ) { |
| 24 | 24 | |
| 25 | 25 | /** Defaults **************************************************************/ |
| @@ -117,13 +117,13 @@ | ||
| 117 | 117 | return apply_filters( 'bbp_has_search_results', $bbp->search_query->have_posts(), $bbp->search_query ); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * Whether there are more search results available in the loop. | |
| 121 | + * Whether there are more search results available in the loop | |
| 122 | 122 | * |
| 123 | 123 | * @since 2.3.0 bbPress (r4579) |
| 124 | 124 | * |
| 125 | - * @return object Search information. | |
| 125 | + * @return object Search information | |
| 126 | 126 | */ |
| 127 | 127 | function bbp_search_results() { |
| 128 | 128 | |
| 129 | 129 | // Put into variable to check against next |
| @@ -137,13 +137,13 @@ | ||
| 137 | 137 | return $have_posts; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | - * Loads up the current search result in the loop. | |
| 141 | + * Loads up the current search result in the loop | |
| 142 | 142 | * |
| 143 | 143 | * @since 2.3.0 bbPress (r4579) |
| 144 | 144 | * |
| 145 | - * @return object Search information. | |
| 145 | + * @return object Search information | |
| 146 | 146 | */ |
| 147 | 147 | function bbp_the_search_result() { |
| 148 | 148 | $search_result = bbpress()->search_query->the_post(); |
| 149 | 149 | |
| @@ -155,9 +155,9 @@ | ||
| 155 | 155 | return $search_result; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * Output the search page title. | |
| 159 | + * Output the search page title | |
| 160 | 160 | * |
| 161 | 161 | * @since 2.3.0 bbPress (r4579) |
| 162 | 162 | */ |
| 163 | 163 | function bbp_search_title() { |
| @@ -163,13 +163,13 @@ | ||
| 163 | 163 | function bbp_search_title() { |
| 164 | 164 | echo bbp_get_search_title(); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -/** | |
| 168 | - * Get the search page title. | |
| 169 | - * | |
| 170 | - * @since 2.3.0 bbPress (r4579) | |
| 171 | - */ | |
| 167 | + /** | |
| 168 | + * Get the search page title | |
| 169 | + * | |
| 170 | + * @since 2.3.0 bbPress (r4579) | |
| 171 | + */ | |
| 172 | 172 | function bbp_get_search_title() { |
| 173 | 173 | |
| 174 | 174 | // Get search terms |
| 175 | 175 | $search_terms = bbp_get_search_terms(); |
| @@ -188,9 +188,9 @@ | ||
| 188 | 188 | return apply_filters( 'bbp_get_search_title', $title, $search_terms ); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | - * Output the search url. | |
| 192 | + * Output the search url | |
| 193 | 193 | * |
| 194 | 194 | * @since 2.3.0 bbPress (r4579) |
| 195 | 195 | */ |
| 196 | 196 | function bbp_search_url() { |
| @@ -195,16 +195,15 @@ | ||
| 195 | 195 | */ |
| 196 | 196 | function bbp_search_url() { |
| 197 | 197 | echo esc_url( bbp_get_search_url() ); |
| 198 | 198 | } |
| 199 | - | |
| 200 | -/** | |
| 201 | - * Return the search url. | |
| 202 | - * | |
| 203 | - * @since 2.3.0 bbPress (r4579) | |
| 204 | - * | |
| 205 | - * @return string Search url. | |
| 206 | - */ | |
| 199 | + /** | |
| 200 | + * Return the search url | |
| 201 | + * | |
| 202 | + * @since 2.3.0 bbPress (r4579) | |
| 203 | + * | |
| 204 | + * @return string Search url | |
| 205 | + */ | |
| 207 | 206 | function bbp_get_search_url() { |
| 208 | 207 | |
| 209 | 208 | // Pretty permalinks |
| 210 | 209 | if ( bbp_use_pretty_urls() ) { |
| @@ -228,9 +227,9 @@ | ||
| 228 | 227 | return apply_filters( 'bbp_get_search_url', $url ); |
| 229 | 228 | } |
| 230 | 229 | |
| 231 | 230 | /** |
| 232 | - * Output the search results url. | |
| 231 | + * Output the search results url | |
| 233 | 232 | * |
| 234 | 233 | * @since 2.4.0 bbPress (r4928) |
| 235 | 234 | */ |
| 236 | 235 | function bbp_search_results_url() { |
| @@ -235,16 +234,15 @@ | ||
| 235 | 234 | */ |
| 236 | 235 | function bbp_search_results_url() { |
| 237 | 236 | echo esc_url( bbp_get_search_results_url() ); |
| 238 | 237 | } |
| 239 | - | |
| 240 | -/** | |
| 241 | - * Return the search url. | |
| 242 | - * | |
| 243 | - * @since 2.4.0 bbPress (r4928) | |
| 244 | - * | |
| 245 | - * @return string Search url. | |
| 246 | - */ | |
| 238 | + /** | |
| 239 | + * Return the search url | |
| 240 | + * | |
| 241 | + * @since 2.4.0 bbPress (r4928) | |
| 242 | + * | |
| 243 | + * @return string Search url | |
| 244 | + */ | |
| 247 | 245 | function bbp_get_search_results_url() { |
| 248 | 246 | |
| 249 | 247 | // Get the search terms |
| 250 | 248 | $search_terms = bbp_get_search_terms(); |
| @@ -278,29 +276,29 @@ | ||
| 278 | 276 | return apply_filters( 'bbp_get_search_results_url', $url ); |
| 279 | 277 | } |
| 280 | 278 | |
| 281 | 279 | /** |
| 282 | - * Output the search terms. | |
| 280 | + * Output the search terms | |
| 283 | 281 | * |
| 284 | 282 | * @since 2.3.0 bbPress (r4579) |
| 285 | 283 | * |
| 286 | - * @param string $search_terms Optional. Search terms. | |
| 284 | + * @param string $search_terms Optional. Search terms | |
| 287 | 285 | */ |
| 288 | 286 | function bbp_search_terms( $search_terms = '' ) { |
| 289 | 287 | echo esc_attr( bbp_get_search_terms( $search_terms ) ); |
| 290 | 288 | } |
| 291 | 289 | |
| 292 | -/** | |
| 293 | - * Get the search terms. | |
| 294 | - * | |
| 295 | - * @since 2.3.0 bbPress (r4579) | |
| 296 | - * | |
| 297 | - * If search terms are supplied, those are used. Otherwise check the | |
| 298 | - * search rewrite id query var. | |
| 299 | - * | |
| 300 | - * @param string $passed_terms Optional. Search terms. | |
| 301 | - * @return bool|string Search terms on success, false on failure. | |
| 302 | - */ | |
| 290 | + /** | |
| 291 | + * Get the search terms | |
| 292 | + * | |
| 293 | + * @since 2.3.0 bbPress (r4579) | |
| 294 | + * | |
| 295 | + * If search terms are supplied, those are used. Otherwise check the | |
| 296 | + * search rewrite id query var. | |
| 297 | + * | |
| 298 | + * @param string $passed_terms Optional. Search terms | |
| 299 | + * @return bool|string Search terms on success, false on failure | |
| 300 | + */ | |
| 303 | 301 | function bbp_get_search_terms( $passed_terms = '' ) { |
| 304 | 302 | |
| 305 | 303 | // Sanitize terms if they were passed in |
| 306 | 304 | if ( ! empty( $passed_terms ) ) { |
| @@ -354,9 +352,9 @@ | ||
| 354 | 352 | |
| 355 | 353 | /** Pagination ****************************************************************/ |
| 356 | 354 | |
| 357 | 355 | /** |
| 358 | - * Return the base URL used inside of pagination links. | |
| 356 | + * Return the base URL used inside of pagination links | |
| 359 | 357 | * |
| 360 | 358 | * @since 2.6.0 bbPress (r6680) |
| 361 | 359 | * |
| 362 | 360 | * @return string |
| @@ -387,9 +385,9 @@ | ||
| 387 | 385 | return apply_filters( 'bbp_get_search_pagination_base', $base ); |
| 388 | 386 | } |
| 389 | 387 | |
| 390 | 388 | /** |
| 391 | - * Output the search result pagination count. | |
| 389 | + * Output the search result pagination count | |
| 392 | 390 | * |
| 393 | 391 | * @since 2.3.0 bbPress (r4579) |
| 394 | 392 | */ |
| 395 | 393 | function bbp_search_pagination_count() { |
| @@ -395,15 +393,15 @@ | ||
| 395 | 393 | function bbp_search_pagination_count() { |
| 396 | 394 | echo bbp_get_search_pagination_count(); |
| 397 | 395 | } |
| 398 | 396 | |
| 399 | -/** | |
| 400 | - * Return the search results pagination count. | |
| 401 | - * | |
| 402 | - * @since 2.3.0 bbPress (r4579) | |
| 403 | - * | |
| 404 | - * @return string Search pagination count. | |
| 405 | - */ | |
| 397 | + /** | |
| 398 | + * Return the search results pagination count | |
| 399 | + * | |
| 400 | + * @since 2.3.0 bbPress (r4579) | |
| 401 | + * | |
| 402 | + * @return string Search pagination count | |
| 403 | + */ | |
| 406 | 404 | function bbp_get_search_pagination_count() { |
| 407 | 405 | $bbp = bbpress(); |
| 408 | 406 | |
| 409 | 407 | // Define local variable(s) |
| @@ -435,9 +433,9 @@ | ||
| 435 | 433 | } else { |
| 436 | 434 | $retstr = sprintf( |
| 437 | 435 | /* translators: 1: Number of results being viewed, 2: First result number, 3: Last result number, 4: Total results */ |
| 438 | 436 | _n( |
| 439 | - 'Viewing %1$s result - %2$s through %3$s (of %4$s total)', | |
| 437 | + 'Viewing %2$s results (of %4$s total)', | |
| 440 | 438 | 'Viewing %1$s results - %2$s through %3$s (of %4$s total)', |
| 441 | 439 | $bbp->search_query->post_count, |
| 442 | 440 | 'bbpress' |
| 443 | 441 | ), |
| @@ -446,15 +444,16 @@ | ||
| 446 | 444 | $to_num, |
| 447 | 445 | $total_num |
| 448 | 446 | ); |
| 449 | 447 | |
| 450 | - // Filter & return | |
| 451 | - return apply_filters( 'bbp_get_search_pagination_count', esc_html( $retstr ) ); | |
| 452 | 448 | } |
| 449 | + | |
| 450 | + // Filter & return | |
| 451 | + return apply_filters( 'bbp_get_search_pagination_count', esc_html( $retstr ) ); | |
| 453 | 452 | } |
| 454 | 453 | |
| 455 | 454 | /** |
| 456 | - * Output search pagination links. | |
| 455 | + * Output search pagination links | |
| 457 | 456 | * |
| 458 | 457 | * @since 2.3.0 bbPress (r4579) |
| 459 | 458 | */ |
| 460 | 459 | function bbp_search_pagination_links() { |
| @@ -460,21 +459,21 @@ | ||
| 460 | 459 | function bbp_search_pagination_links() { |
| 461 | 460 | echo bbp_get_search_pagination_links(); |
| 462 | 461 | } |
| 463 | 462 | |
| 464 | -/** | |
| 465 | - * Return search pagination links. | |
| 466 | - * | |
| 467 | - * @since 2.3.0 bbPress (r4579) | |
| 468 | - * | |
| 469 | - * @return string Search pagination links. | |
| 470 | - */ | |
| 471 | -function bbp_get_search_pagination_links() { | |
| 463 | + /** | |
| 464 | + * Return search pagination links | |
| 465 | + * | |
| 466 | + * @since 2.3.0 bbPress (r4579) | |
| 467 | + * | |
| 468 | + * @return string Search pagination links | |
| 469 | + */ | |
| 470 | + function bbp_get_search_pagination_links() { | |
| 472 | 471 | $bbp = bbpress(); |
| 473 | 472 | |
| 474 | 473 | if ( ! isset( $bbp->search_query->pagination_links ) || empty( $bbp->search_query->pagination_links ) ) { |
| 475 | 474 | return false; |
| 476 | - } | |
| 475 | + } | |
| 477 | 476 | |
| 478 | 477 | // Filter & return |
| 479 | 478 | return apply_filters( 'bbp_get_search_pagination_links', $bbp->search_query->pagination_links ); |
| 480 | -} | |
| 479 | + } | |