diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 8eb9f9bd40..13e39aca27 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -484,7 +484,7 @@ endif; /** * Returns the URL from the post. * - * @uses get_content_url() to get the URL in the post meta (if it exists) or + * @uses get_url_in_content() to get the URL in the post meta (if it exists) or * the first link found in the post content. * * Falls back to the post permalink if no URL is found in the post. @@ -495,7 +495,7 @@ endif; */ function twentythirteen_get_link_url() { $content = get_the_content(); - $has_url = get_content_url( $content ); + $has_url = get_url_in_content( $content ); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } diff --git a/wp-includes/media.php b/wp-includes/media.php index 5b5501a158..ecbedbacb1 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -857,7 +857,7 @@ function wp_audio_shortcode( $attr ) { $default_types = wp_get_audio_extensions(); $defaults_atts = array( 'src' => '' ); - foreach ( $default_types as $type ) + foreach ( $default_types as $type ) $defaults_atts[$type] = ''; $atts = shortcode_atts( $defaults_atts, $attr, 'audio' ); @@ -963,7 +963,7 @@ function wp_video_shortcode( $attr ) { 'width' => empty( $content_width ) ? 640 : $content_width, ); - foreach ( $default_types as $type ) + foreach ( $default_types as $type ) $defaults_atts[$type] = ''; $atts = shortcode_atts( $defaults_atts, $attr, 'video' ); @@ -1444,7 +1444,7 @@ function wp_get_image_editor( $path, $args = array() ) { $args['path'] = $path; if ( ! isset( $args['mime_type'] ) ) { - $file_info = wp_check_filetype( $args['path'] ); + $file_info = wp_check_filetype( $args['path'] ); // If $file_info['type'] is false, then we let the editor attempt to // figure out the file type, rather than forcing a failure based on extension. @@ -1473,7 +1473,7 @@ function wp_get_image_editor( $path, $args = array() ) { * @since 3.5.0 * @access public * - * @param string|array $args Array of requirements. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} } + * @param string|array $args Array of requirements. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} } * @return boolean true if an eligible editor is found; false otherwise */ function wp_image_editor_supports( $args = array() ) { @@ -1842,12 +1842,12 @@ function wp_enqueue_media( $args = array() ) { * @since 3.6.0 * * @param string $type (Mime) type of media desired - * @param int $post_id Post ID + * @param mixed $post Post ID or object * @return array Found attachments */ -function get_attached_media( $type, $post_id = 0 ) { - if ( ! $post = get_post( $post_id ) ) - return; +function get_attached_media( $type, $post = 0 ) { + if ( ! $post = get_post( $post ) ) + return array(); $args = array( 'post_parent' => $post->ID, @@ -1866,158 +1866,26 @@ function get_attached_media( $type, $post_id = 0 ) { } /** - * Extract and parse {media type} shortcodes or srcs from the passed content + * Check the content blob for an