Ticket #23974: 23974.2.patch
File 23974.2.patch, 6.0 KB (added by , 11 years ago) |
---|
-
wp-includes/post-formats.php
11 11 * 12 12 * @since 3.1.0 13 13 * 14 * @param int|object $post A post 14 * @param int|object $post A post. 15 15 * 16 16 * @return mixed The format if successful. False if no format is set. WP_Error if errors. 17 17 */ … … 35 35 * Check if a post has a particular format 36 36 * 37 37 * @since 3.1.0 38 * 38 39 * @uses has_term() 39 40 * 40 * @param string $format The format to check for 41 * @param object|i d$post The post to check. If not supplied, defaults to the current post if used in the loop.41 * @param string $format The format to check for. 42 * @param object|int $post The post to check. If not supplied, defaults to the current post if used in the loop. 42 43 * @return bool True if the post has the format, false otherwise. 43 44 */ 44 45 function has_post_format( $format, $post = null ) { … … 50 51 * 51 52 * @since 3.1.0 52 53 * 53 * @param int|object $post The post for which to assign a format 54 * @param string $format 54 * @param int|object $post The post for which to assign a format. 55 * @param string $format A format to assign. Use an empty string or array to remove all formats from the post. 55 56 * @return mixed WP_Error on error. Array of affected term IDs on success. 56 57 */ 57 58 function set_post_format( $post, $format ) { … … 76 77 * 77 78 * @since 3.6.0 78 79 * 79 * @param int $post_id 80 * @return null80 * @param int $post_id (optional) The post ID. 81 * @return array The array of post format metadata. 81 82 */ 82 83 function get_post_format_meta( $post_id = 0 ) { 83 84 $values = array( … … 101 102 * 102 103 * @since 3.1.0 103 104 * 104 * @return array The array of translat ions105 * @return array The array of translated post format slugs. 105 106 */ 106 107 function get_post_format_strings() { 107 108 $strings = array( … … 124 125 * 125 126 * @since 3.1.0 126 127 * 128 * @uses get_post_format_strings() 129 * 127 130 * @return array The array of post format slugs. 128 131 */ 129 132 function get_post_format_slugs() { … … 136 139 * 137 140 * @since 3.1.0 138 141 * 139 * @param string $slug A post format slug 140 * @return string The translated post format name 142 * @uses get_post_format_strings() 143 * 144 * @param string $slug A post format slug. 145 * @return string The translated post format name. 141 146 */ 142 147 function get_post_format_string( $slug ) { 143 148 $strings = get_post_format_strings(); … … 152 157 * 153 158 * @since 3.1.0 154 159 * 155 * @param string $format Post format156 * @return string Link160 * @param string $format The post format slug. 161 * @return string The post format term link. 157 162 */ 158 163 function get_post_format_link( $format ) { 159 164 $term = get_term_by('slug', 'post-format-' . $format, 'post_format' ); … … 259 264 * 260 265 * @since 3.6.0 261 266 * 262 * @param string $format 267 * @param string $format The post format slug, such as status, quote, image, gallery, etc. 268 * @return string Filtered post format content class. 263 269 */ 264 270 function get_post_format_content_class( $format ) { 265 271 return apply_filters( 'post_format_content_class', 'post-format-content', $format ); 266 272 } 267 273 268 274 /** 269 * Ou put the class for a post format content wrapper275 * Output the class for a post format content wrapper 270 276 * 271 277 * @since 3.6.0 272 278 * 273 * @param string $format 279 * @param string $format The post format slug, such as status, quote, image, gallery, etc. 274 280 */ 275 281 function post_format_content_class( $format ) { 276 282 echo get_post_format_content_class( $format ); … … 281 287 * 282 288 * @since 3.6.0 283 289 * 284 * @param string $content 290 * @uses get_post_format_meta() 291 * 292 * @param string $content The post content. 293 * @param int $id (optional) The Post ID. 294 * @return string Formatted output based on associated post format. 285 295 */ 286 296 function post_formats_compat( $content, $id = 0 ) { 287 297 $post = empty( $id ) ? get_post() : get_post( $id ); … … 422 432 * @since 3.6.0 423 433 * 424 434 * @global array $_wp_chat_parsers 435 * 425 436 * @param string $name Unique identifier for chat format. Example: IRC 426 437 * @param string $newline_regex RegEx to match the start of a new line, typically when a new "username:" appears 427 438 * The parser will handle up to 3 matched expressions … … 451 462 * If the content does not contain username syntax, assume that it does not contain 452 463 * chat logs and return 453 464 * 454 * @since 3.6.0455 *456 465 * Example: 457 466 * 458 467 * One stanza of chat: … … 473 482 * ) 474 483 * ) 475 484 * ) 476 * @param string $content A string which might contain chat data. 485 * 486 * @since 3.6.0 487 * 488 * @param string $content A string which might contain chat data, passed by reference. 477 489 * @param boolean $remove Whether to remove the found data from the passed content. 478 490 * @return array A chat log as structured data 479 491 */ … … 571 583 * 572 584 * @since 3.6.0 573 585 * 574 * @param int $id Optional. Post ID575 * @return array 586 * @param int $id (optional) The post ID. 587 * @return array The chat content. 576 588 */ 577 589 function get_the_post_format_chat( $id = 0 ) { 578 590 $post = empty( $id ) ? clone get_post() : get_post( $id ); … … 629 641 * 630 642 * @since 3.6.0 631 643 * 632 * @param string $content A string which might contain a URL .644 * @param string $content A string which might contain a URL, passed by reference. 633 645 * @param boolean $remove Whether to remove the found URL from the passed content. 634 646 * @return string The found URL. 635 647 */ … … 670 682 * 671 683 * @since 3.6.0 672 684 * 673 * @param int $id Optional. Post ID.685 * @param int $id (optional) The post ID. 674 686 * @return string A URL, if found. 675 687 */ 676 688 function get_the_post_format_url( $id = 0 ) { … … 707 719 * 708 720 * @param string $more_link_text Optional. Content for when there is more text. 709 721 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 710 * @return string 722 * @return string The content minus the extracted post format content. 711 723 */ 712 724 function get_the_remaining_content( $more_link_text = null, $strip_teaser = false ) { 713 725 global $more, $page, $format_pages, $multipage, $preview;