Make WordPress Core

Changeset 16830


Ignore:
Timestamp:
12/09/2010 05:27:37 AM (14 years ago)
Author:
scribu
Message:

Clarify is_single() inline doc. Fixes #14034

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r16819 r16830  
    399399
    400400/**
    401  * Is the query for a single Page?
     401 * Is the query for a single page?
    402402 *
    403403 * If the $page parameter is specified, this function will additionally
    404  * check if the query is for one of the Pages specified.
     404 * check if the query is for one of the pages specified.
    405405 *
    406406 * @see is_single()
    407407 * @see is_singular()
    408408 *
     409 * @see WP_Query::is_page()
     410 * @since 1.5.0
     411 * @uses $wp_query
     412 *
     413 * @param mixed $page Page ID, title, slug, or array of such.
     414 * @return bool
     415 */
     416function is_page( $page = '' ) {
     417    global $wp_query;
     418
     419    return $wp_query->is_page( $page );
     420}
     421
     422/**
     423 * Is the query for paged result and not for the first page?
     424 *
     425 * @see WP_Query::is_paged()
     426 * @since 1.5.0
     427 * @uses $wp_query
     428 *
     429 * @return bool
     430 */
     431function is_paged() {
     432    global $wp_query;
     433
     434    return $wp_query->is_paged();
     435}
     436
     437/**
     438 * Is the query for a post or page preview?
     439 *
     440 * @see WP_Query::is_preview()
     441 * @since 2.0.0
     442 * @uses $wp_query
     443 *
     444 * @return bool
     445 */
     446function is_preview() {
     447    global $wp_query;
     448
     449    return $wp_query->is_preview();
     450}
     451
     452/**
     453 * Is the query for the robots file?
     454 *
     455 * @see WP_Query::is_robots()
     456 * @since 2.1.0
     457 * @uses $wp_query
     458 *
     459 * @return bool
     460 */
     461function is_robots() {
     462    global $wp_query;
     463
     464    return $wp_query->is_robots();
     465}
     466
     467/**
     468 * Is the query for a search?
     469 *
     470 * @see WP_Query::is_search()
     471 * @since 1.5.0
     472 * @uses $wp_query
     473 *
     474 * @return bool
     475 */
     476function is_search() {
     477    global $wp_query;
     478
     479    return $wp_query->is_search();
     480}
     481
     482/**
     483 * Is the query for a single post?
     484 *
     485 * Works for any post type, except attachments and pages
     486 *
     487 * If the $post parameter is specified, this function will additionally
     488 * check if the query is for one of the Posts specified.
     489 *
     490 * @see is_page()
     491 * @see is_singular()
     492 *
    409493 * @see WP_Query::is_single()
    410494 * @since 1.5.0
    411495 * @uses $wp_query
    412496 *
    413  * @param mixed $page Page ID, title, slug, or array of Page IDs, titles, and slugs.
    414  * @return bool
    415  */
    416 function is_page( $page = '' ) {
    417     global $wp_query;
    418 
    419     return $wp_query->is_page( $page );
    420 }
    421 
    422 /**
    423  * Is the query for paged result and not for the first page?
    424  *
    425  * @see WP_Query::is_paged()
    426  * @since 1.5.0
    427  * @uses $wp_query
    428  *
    429  * @return bool
    430  */
    431 function is_paged() {
    432     global $wp_query;
    433 
    434     return $wp_query->is_paged();
    435 }
    436 
    437 /**
    438  * Is the query for a post or page preview?
    439  *
    440  * @see WP_Query::is_preview()
    441  * @since 2.0.0
    442  * @uses $wp_query
    443  *
    444  * @return bool
    445  */
    446 function is_preview() {
    447     global $wp_query;
    448 
    449     return $wp_query->is_preview();
    450 }
    451 
    452 /**
    453  * Is the query for the robots file?
    454  *
    455  * @see WP_Query::is_robots()
    456  * @since 2.1.0
    457  * @uses $wp_query
    458  *
    459  * @return bool
    460  */
    461 function is_robots() {
    462     global $wp_query;
    463 
    464     return $wp_query->is_robots();
    465 }
    466 
    467 /**
    468  * Is the query for a search?
    469  *
    470  * @see WP_Query::is_search()
    471  * @since 1.5.0
    472  * @uses $wp_query
    473  *
    474  * @return bool
    475  */
    476 function is_search() {
    477     global $wp_query;
    478 
    479     return $wp_query->is_search();
    480 }
    481 
    482 /**
    483  * Is the query for a single post?
    484  *
    485  * If the $post parameter is specified, this function will additionally
    486  * check if the query is for one of the Posts specified.
    487  *
    488  * Can also be used for attachments or any other post type except pages.
    489  *
    490  * @see is_page()
    491  * @see is_singular()
    492  *
    493  * @see WP_Query::is_single()
    494  * @since 1.5.0
    495  * @uses $wp_query
    496  *
    497  * @param mixed $post Post ID, title, slug, or array of Post IDs, titles, and slugs.
     497 * @param mixed $post Post ID, title, slug, or array of such.
    498498 * @return bool
    499499 */
     
    30253025
    30263026    /**
    3027      * Is the query for a single Page?
     3027     * Is the query for a single page?
    30283028     *
    30293029     * If the $page parameter is specified, this function will additionally
    3030      * check if the query is for one of the Pages specified.
     3030     * check if the query is for one of the pages specified.
    30313031     *
    30323032     * @see WP_Query::is_single()
     
    30353035     * @since 3.1.0
    30363036     *
    3037      * @param mixed $page Page ID, title, slug, or array of Page IDs, titles, and slugs.
     3037     * @param mixed $page Page ID, title, slug, or array of such.
    30383038     * @return bool
    30393039     */
     
    31063106     * Is the query for a single post?
    31073107     *
     3108     * Works for any post type, except attachments and pages
     3109     *
    31083110     * If the $post parameter is specified, this function will additionally
    31093111     * check if the query is for one of the Posts specified.
    31103112     *
    3111      * Can also be used for attachments or any other post type except pages.
    3112      *
    31133113     * @see WP_Query::is_page()
    31143114     * @see WP_Query::is_singular()
     
    31163116     * @since 3.1.0
    31173117     *
    3118      * @param mixed $post Post ID, title, slug, or array of Post IDs, titles, and slugs.
     3118     * @param mixed $post Post ID, title, slug, or array of such.
    31193119     * @return bool
    31203120     */
Note: See TracChangeset for help on using the changeset viewer.