diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index fc1b1509e0..6dc87e2d18 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3264,7 +3264,6 @@ function sanitize_text_field($str) { $filtered = trim( preg_replace('/[\r\n\t ]+/', ' ', $filtered) ); } - $match = array(); $found = false; while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) { $filtered = str_replace($match[0], '', $filtered); diff --git a/wp-includes/media.php b/wp-includes/media.php index 36736cef20..52037b959a 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1908,7 +1908,6 @@ function get_attached_video( $post_id = 0 ) { */ function get_content_media( $type, &$content, $html = true, $remove = false, $limit = 0 ) { $items = array(); - $matches = array(); if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { foreach ( $matches as $shortcode ) { @@ -1927,7 +1926,6 @@ function get_content_media( $type, &$content, $html = true, $remove = false, $li if ( $html ) return $items; - $src = ''; $data = array(); foreach ( $items as $item ) { @@ -1958,7 +1956,6 @@ function get_content_media( $type, &$content, $html = true, $remove = false, $li */ function get_embedded_media( $type, &$content, $remove = false, $limit = 0 ) { $html = array(); - $matches = ''; foreach ( array( $type, 'object', 'embed', 'iframe' ) as $tag ) { if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) { @@ -2206,7 +2203,6 @@ function get_attached_image_srcs( $post_id = 0 ) { * @return array The found images or srcs */ function get_content_images( &$content, $html = true, $remove = false, $limit = 0 ) { - $matches = array(); $tags = array(); $captions = array(); @@ -2255,7 +2251,6 @@ function get_content_images( &$content, $html = true, $remove = false, $limit = if ( $html ) return $tags; - $src = ''; $srcs = array(); foreach ( $tags as $tag ) { @@ -2300,9 +2295,7 @@ function get_content_image( &$content, $html = true, $remove = false ) { * @return array A list of galleries, which in turn are a list of their srcs in order */ function get_content_galleries( &$content, $html = true, $remove = false, $limit = 0 ) { - $src = ''; $galleries = array(); - $matches = array(); if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { foreach ( $matches as $shortcode ) { @@ -2493,7 +2486,6 @@ function get_the_post_format_image( $attached_size = 'full', &$post = null ) { $urls[] = get_attachment_link( $media->ID ); $count = 1; - $matches = array(); $content = $post->post_content; if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) && ! empty( $matches ) ) { diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index 3bb380a612..e8b92ba0e9 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -580,7 +580,6 @@ function get_content_chat( &$content, $remove = false ) { continue; } - $matches = array(); $matched = preg_match( $newline_regex, $line, $matches ); if ( ! $matched ) continue; @@ -709,7 +708,6 @@ function get_content_quote( &$content, $remove = false, $replace = '' ) { if ( empty( $content ) ) return ''; - $matches = array(); if ( ! preg_match( '/
]*>(.+?)<\/blockquote>/is', $content, $matches ) ) { $quote = $content; if ( $remove || ! empty( $replace ) ) @@ -783,8 +781,6 @@ function get_content_url( &$content, $remove = false ) { if ( empty( $content ) ) return ''; - $matches = array(); - // the content is a URL $trimmed = trim( $content ); if ( 0 === stripos( $trimmed, 'http' ) && ! preg_match( '#\s#', $trimmed ) ) { @@ -883,7 +879,6 @@ function get_the_remaining_content( $more_link_text = null, $strip_teaser = fals $output = ''; $has_teaser = false; - $matches = array(); // If post password required and it doesn't match the cookie. if ( post_password_required() ) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 23173997f7..a67b0e1435 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -185,7 +185,6 @@ function get_the_content( $more_link_text = null, $strip_teaser = false ) { $output = ''; $has_teaser = false; - $matches = array(); // If post password required and it doesn't match the cookie. if ( post_password_required() ) diff --git a/wp-includes/shortcodes.php b/wp-includes/shortcodes.php index b7a0b1ba0b..a40959491b 100644 --- a/wp-includes/shortcodes.php +++ b/wp-includes/shortcodes.php @@ -152,7 +152,6 @@ function shortcode_exists( $tag ) { */ function has_shortcode( $content, $tag ) { if ( shortcode_exists( $tag ) ) { - $matches = array(); preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ); if ( empty( $matches ) ) return false;