WordPress.org

Make WordPress Core

Ticket #23974: 23974.2.patch

File 23974.2.patch, 6.0 KB (added by DrewAPicture, 5 years ago)

More.

  • wp-includes/post-formats.php

     
    1111 *
    1212 * @since 3.1.0
    1313 *
    14  * @param int|object $post A post
     14 * @param int|object $post A post.
    1515 *
    1616 * @return mixed The format if successful. False if no format is set. WP_Error if errors.
    1717 */
     
    3535 * Check if a post has a particular format
    3636 *
    3737 * @since 3.1.0
     38 *
    3839 * @uses has_term()
    3940 *
    40  * @param string $format The format to check for
    41  * @param object|id $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.
    4243 * @return bool True if the post has the format, false otherwise.
    4344 */
    4445function has_post_format( $format, $post = null ) {
     
    5051 *
    5152 * @since 3.1.0
    5253 *
    53  * @param int|object $post The post for which to assign a format
    54  * @param string $format  A format to assign. Use an empty string or array to remove all formats from the post.
     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.
    5556 * @return mixed WP_Error on error. Array of affected term IDs on success.
    5657 */
    5758function set_post_format( $post, $format ) {
     
    7677 *
    7778 * @since 3.6.0
    7879 *
    79  * @param int $post_id
    80  * @return null
     80 * @param int $post_id (optional) The post ID.
     81 * @return array The array of post format metadata.
    8182 */
    8283function get_post_format_meta( $post_id = 0 ) {
    8384        $values = array(
     
    101102 *
    102103 * @since 3.1.0
    103104 *
    104  * @return array The array of translations
     105 * @return array The array of translated post format slugs.
    105106 */
    106107function get_post_format_strings() {
    107108        $strings = array(
     
    124125 *
    125126 * @since 3.1.0
    126127 *
     128 * @uses get_post_format_strings()
     129 *
    127130 * @return array The array of post format slugs.
    128131 */
    129132function get_post_format_slugs() {
     
    136139 *
    137140 * @since 3.1.0
    138141 *
    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.
    141146 */
    142147function get_post_format_string( $slug ) {
    143148        $strings = get_post_format_strings();
     
    152157 *
    153158 * @since 3.1.0
    154159 *
    155  * @param string $format Post format
    156  * @return string Link
     160 * @param string $format The post format slug.
     161 * @return string The post format term link.
    157162 */
    158163function get_post_format_link( $format ) {
    159164        $term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
     
    259264 *
    260265 * @since 3.6.0
    261266 *
    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.
    263269 */
    264270function get_post_format_content_class( $format ) {
    265271        return apply_filters( 'post_format_content_class', 'post-format-content', $format );
    266272}
    267273
    268274/**
    269  * Ouput the class for a post format content wrapper
     275 * Output the class for a post format content wrapper
    270276 *
    271277 * @since 3.6.0
    272278 *
    273  * @param string $format
     279 * @param string $format The post format slug, such as status, quote, image, gallery, etc.
    274280 */
    275281function post_format_content_class( $format ) {
    276282        echo get_post_format_content_class( $format );
     
    281287 *
    282288 * @since 3.6.0
    283289 *
    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.
    285295 */
    286296function post_formats_compat( $content, $id = 0 ) {
    287297        $post = empty( $id ) ? get_post() : get_post( $id );
     
    422432 * @since 3.6.0
    423433 *
    424434 * @global array $_wp_chat_parsers
     435 *
    425436 * @param string $name Unique identifier for chat format. Example: IRC
    426437 * @param string $newline_regex RegEx to match the start of a new line, typically when a new "username:" appears
    427438 *      The parser will handle up to 3 matched expressions
     
    451462 * If the content does not contain username syntax, assume that it does not contain
    452463 * chat logs and return
    453464 *
    454  * @since 3.6.0
    455  *
    456465 * Example:
    457466 *
    458467 * One stanza of chat:
     
    473482 *         )
    474483 *     )
    475484 * )
    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.
    477489 * @param boolean $remove Whether to remove the found data from the passed content.
    478490 * @return array A chat log as structured data
    479491 */
     
    571583 *
    572584 * @since 3.6.0
    573585 *
    574  * @param int $id Optional. Post ID
    575  * @return array
     586 * @param int $id (optional) The post ID.
     587 * @return array The chat content.
    576588 */
    577589function get_the_post_format_chat( $id = 0 ) {
    578590        $post = empty( $id ) ? clone get_post() : get_post( $id );
     
    629641 *
    630642 * @since 3.6.0
    631643 *
    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.
    633645 * @param boolean $remove Whether to remove the found URL from the passed content.
    634646 * @return string The found URL.
    635647 */
     
    670682 *
    671683 * @since 3.6.0
    672684 *
    673  * @param int $id Optional. Post ID.
     685 * @param int $id (optional) The post ID.
    674686 * @return string A URL, if found.
    675687 */
    676688function get_the_post_format_url( $id = 0 ) {
     
    707719 *
    708720 * @param string $more_link_text Optional. Content for when there is more text.
    709721 * @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.
    711723 */
    712724function get_the_remaining_content( $more_link_text = null, $strip_teaser = false ) {
    713725        global $more, $page, $format_pages, $multipage, $preview;