Make WordPress Core

Changeset 20382


Ignore:
Timestamp:
04/06/2012 08:05:31 PM (13 years ago)
Author:
nacin
Message:

Use _callback, rather than an unhelpful 2, for a preg_replace callback function name. Add proper phpdoc. see #20369.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r20381 r20382  
    165165add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
    166166
    167 // Private, preg_replace callback used in image_add_caption()
     167/**
     168 * Private preg_replace callback used in image_add_caption()
     169 *
     170 * @access private
     171 * @since 3.4.0
     172 */
    168173function _cleanup_image_add_caption( $matches ) {
    169174    // remove any line breaks from inside the tags
    170175    $s = preg_replace( '/[\r\n\t]+/', ' ', $matches[0] );
    171176    // look for single quotes inside html attributes (for example in title)
    172     $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption2', $s );
     177    $s = preg_replace_callback( '/="[^"]+"/', '_cleanup_image_add_caption_callback', $s );
    173178    return str_replace( '"', "'", $s );
    174179}
    175180
    176 // Private, preg_replace callback used in image_add_caption()
    177 function _cleanup_image_add_caption2( $matches ) {
     181/**
     182 * Private preg_replace callback used in _cleanup_image_add_caption()
     183 *
     184 * @access private
     185 * @since 3.4.0
     186 */
     187function _cleanup_image_add_caption_callback( $matches ) {
    178188    return str_replace( "'", ''', $matches[0] );
    179189}
Note: See TracChangeset for help on using the changeset viewer.