> element before content. * * @since 2.0.0 - * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content. * * @param string $content * @return string @@ -1209,11 +1453,33 @@ function prepend_attachment($content) { if ( empty($post->post_type) || $post->post_type != 'attachment' ) return $content; - $p = '
'; - $p = apply_filters('prepend_attachment', $p); + if ( 0 === strpos( $post->post_mime_type, 'video' ) ) { + $meta = wp_get_attachment_metadata( get_the_ID() ); + $atts = array( 'src' => wp_get_attachment_url() ); + if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { + $atts['width'] = (int) $meta['width']; + $atts['height'] = (int) $meta['height']; + } + $p = wp_video_shortcode( $atts ); + } elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ) { + $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); + } else { + $p = ' '; + } + + /** + * Filter the attachment markup to be prepended to the post content. + * + * @since 2.0.0 + * + * @see prepend_attachment() + * + * @param string $p The attachment HTML output. + */ + $p = apply_filters( 'prepend_attachment', $p ); return "$p\n$content"; } @@ -1227,18 +1493,29 @@ function prepend_attachment($content) { * * @since 1.0.0 * @uses apply_filters() Calls 'the_password_form' filter on output. - * @param int|WP_Post $post Optional. A post id or post object. Defaults to the current post when in The Loop, undefined otherwise. + * @param int|WP_Post $post Optional. A post ID or post object. * @return string HTML content for password form for password protected post. */ function get_the_password_form( $post = 0 ) { $post = get_post( $post ); $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID ); - $output = ' + $output = ' '; - return apply_filters('the_password_form', $output); + + /** + * Filter the HTML output for the protected post password form. + * + * If modifying the password field, please note that the core database schema + * limits the password field to 20 characters regardless of the value of the + * size attribute in the form input. + * + * @since 2.7.0 + * + * @param string $output The password form HTML output. + */ + return apply_filters( 'the_password_form', $output ); } /** @@ -1294,8 +1571,6 @@ function get_page_template_slug( $post_id = null ) { /** * Retrieve formatted date timestamp of a revision (linked to that revisions's page). * - * @package WordPress - * @subpackage Post_Revisions * @since 2.6.0 * * @uses date_i18n() @@ -1333,8 +1608,6 @@ function wp_post_revision_title( $revision, $link = true ) { /** * Retrieve formatted date timestamp of a revision (linked to that revisions's page). * - * @package WordPress - * @subpackage Post_Revisions * @since 3.6.0 * * @uses date_i18n() @@ -1386,8 +1659,6 @@ function wp_post_revision_title_expanded( $revision, $link = true ) { * Can output either a UL with edit links or a TABLE with diff interface, and * restore action links. * - * @package WordPress - * @subpackage Post_Revisions * @since 2.6.0 * * @uses wp_get_post_revisions() @@ -1395,7 +1666,7 @@ function wp_post_revision_title_expanded( $revision, $link = true ) { * @uses get_edit_post_link() * @uses get_the_author_meta() * - * @param int|object $post_id Post ID or post object. + * @param int|WP_Post $post_id Optional. Post ID or post object. * @param string $type 'all' (default), 'revision' or 'autosave' * @return null */ @@ -1428,31 +1699,5 @@ function wp_list_post_revisions( $post_id = 0, $type = 'all' ) { echo " "; }