Changeset 16830
- Timestamp:
- 12/09/2010 05:27:37 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r16819 r16830 399 399 400 400 /** 401 * Is the query for a single Page?401 * Is the query for a single page? 402 402 * 403 403 * 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. 405 405 * 406 406 * @see is_single() 407 407 * @see is_singular() 408 408 * 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 */ 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 * 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 * 409 493 * @see WP_Query::is_single() 410 494 * @since 1.5.0 411 495 * @uses $wp_query 412 496 * 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. 498 498 * @return bool 499 499 */ … … 3025 3025 3026 3026 /** 3027 * Is the query for a single Page?3027 * Is the query for a single page? 3028 3028 * 3029 3029 * 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. 3031 3031 * 3032 3032 * @see WP_Query::is_single() … … 3035 3035 * @since 3.1.0 3036 3036 * 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. 3038 3038 * @return bool 3039 3039 */ … … 3106 3106 * Is the query for a single post? 3107 3107 * 3108 * Works for any post type, except attachments and pages 3109 * 3108 3110 * If the $post parameter is specified, this function will additionally 3109 3111 * check if the query is for one of the Posts specified. 3110 3112 * 3111 * Can also be used for attachments or any other post type except pages.3112 *3113 3113 * @see WP_Query::is_page() 3114 3114 * @see WP_Query::is_singular() … … 3116 3116 * @since 3.1.0 3117 3117 * 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. 3119 3119 * @return bool 3120 3120 */
Note: See TracChangeset
for help on using the changeset viewer.