Variables passed by reference do not need to be set first.
props kovshenin. see #24222. git-svn-id: http://core.svn.wordpress.org/trunk@24129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
83faec0a8f
commit
3139a0451e
|
@ -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);
|
||||
|
|
|
@ -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 ) ) {
|
||||
|
|
|
@ -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[^>]*>(.+?)<\/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() )
|
||||
|
|
|
@ -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() )
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue