Make WordPress Core


Ignore:
Timestamp:
09/20/2013 02:50:35 AM (13 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-includes/post-thumbnail-template.php.

Props NikV.
See #25229.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-thumbnail-template.php

    r23227 r25513  
    8686        $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
    8787        $post_thumbnail_id = get_post_thumbnail_id( $post_id );
     88
     89        /**
     90         * Filter the post thumbnail size.
     91         *
     92         * @since 2.9.0
     93         *
     94         * @param string $size The post thumbnail size.
     95         */
    8896        $size = apply_filters( 'post_thumbnail_size', $size );
     97
    8998        if ( $post_thumbnail_id ) {
    90                 do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters
     99
     100                /**
     101                 * Fires before fetching the post thumbnail HTML.
     102                 *
     103                 * Provides "just in time" filtering of all filters in wp_get_attachment_image().
     104                 *
     105                 * @since 2.9.0
     106                 *
     107                 * @param string $post_id           The post ID.
     108                 * @param string $post_thumbnail_id The post thumbnail ID.
     109                 * @param string $size              The post thumbnail size.
     110                 */
     111                do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size );
    91112                if ( in_the_loop() )
    92113                        update_post_thumbnail_cache();
    93114                $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr );
     115
     116                /**
     117                 * Fires after fetching the post thumbnail HTML.
     118                 *
     119                 * @since 2.9.0
     120                 *
     121                 * @param string $post_id           The post ID.
     122                 * @param string $post_thumbnail_id The post thumbnail ID.
     123                 * @param string $size              The post thumbnail size.
     124                 */
    94125                do_action( 'end_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size );
     126
    95127        } else {
    96128                $html = '';
    97129        }
     130        /**
     131         * Filter the post thumbnail HTML.
     132         *
     133         * @since 2.9.0
     134         *
     135         * @param string $html              The post thumbnail HTML.
     136         * @param string $post_id           The post ID.
     137         * @param string $post_thumbnail_id The post thumbnail ID.
     138         * @param string $size              The post thumbnail size.
     139         * @param string $attr              Query string of attributes.
     140         */
    98141        return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );
    99142}
Note: See TracChangeset for help on using the changeset viewer.