Changeset 43177 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 05/07/2018 05:19:48 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post-template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r42843 r43177 430 430 431 431 /** 432 * Display the classes for the post div.432 * Displays the classes for the post container element. 433 433 * 434 434 * @since 2.7.0 … … 443 443 444 444 /** 445 * Retrieves the classes for the post div as an array.445 * Retrieves an array of the class names for the post container element. 446 446 * 447 447 * The class names are many. If the post is a sticky, then the 'sticky' … … 452 452 * 453 453 * The 'post_tag' taxonomy is a special 454 * case; the class has the 'tag-' prefix instead of 'post_tag-'. All class es are455 * passed through the filter, {@see 'post_class'}, with the list of class es, followed by454 * case; the class has the 'tag-' prefix instead of 'post_tag-'. All class names are 455 * passed through the filter, {@see 'post_class'}, with the list of class names, followed by 456 456 * $class parameter value, with the post ID as the last parameter. 457 457 * 458 458 * @since 2.7.0 459 * @since 4.2.0 Custom taxonomy class es were added.460 * 461 * @param string| array $class One or more classes to add to the class list.462 * @param int|WP_Post $post_id Optional. Post ID or post object.463 * @return array Array of classes.459 * @since 4.2.0 Custom taxonomy class names were added. 460 * 461 * @param string|string[] $class Space-separated string or array of class names to add to the class list. 462 * @param int|WP_Post $post_id Optional. Post ID or post object. 463 * @return string[] Array of class names. 464 464 */ 465 465 function get_post_class( $class = '', $post_id = null ) { … … 553 553 554 554 /** 555 * Filters the list of CSS class es for the current post.555 * Filters the list of CSS class names for the current post. 556 556 * 557 557 * @since 2.7.0 558 558 * 559 * @param array $classes An array of post classes.560 * @param array $class An array of additional classes added to the post.561 * @param int $post_id The post ID.559 * @param string[] $classes An array of post class names. 560 * @param string[] $class An array of additional class names added to the post. 561 * @param int $post_id The post ID. 562 562 */ 563 563 $classes = apply_filters( 'post_class', $classes, $class, $post->ID ); … … 567 567 568 568 /** 569 * Display the classes for the body element.569 * Displays the class names for the body element. 570 570 * 571 571 * @since 2.8.0 572 572 * 573 * @param string| array $class One or more classes to add to the class list.573 * @param string|string[] $class Space-separated string or array of class names to add to the class list. 574 574 */ 575 575 function body_class( $class = '' ) { 576 // Separates class es with a single space, collates classes for body element576 // Separates class names with a single space, collates class names for body element 577 577 echo 'class="' . join( ' ', get_body_class( $class ) ) . '"'; 578 578 } 579 579 580 580 /** 581 * Retrieve the classes for the body element as an array.581 * Retrieves an array of the class names for the body element. 582 582 * 583 583 * @since 2.8.0 … … 585 585 * @global WP_Query $wp_query 586 586 * 587 * @param string| array $class One or more classes to add to the class list.588 * @return array Array of classes.587 * @param string|string[] $class Space-separated string or array of class names to add to the class list. 588 * @return string[] Array of class names. 589 589 */ 590 590 function get_body_class( $class = '' ) { … … 801 801 802 802 /** 803 * Filters the list of CSS body class es for the current post or page.803 * Filters the list of CSS body class names for the current post or page. 804 804 * 805 805 * @since 2.8.0 806 806 * 807 * @param array $classes An array of body classes.808 * @param array $class An array of additional classes added to the body.807 * @param string[] $classes An array of body class names. 808 * @param string[] $class An array of additional class names added to the body. 809 809 */ 810 810 $classes = apply_filters( 'body_class', $classes, $class );
Note: See TracChangeset
for help on using the changeset viewer.