WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/22/2016 06:24:48 PM (5 years ago)
Author:
DrewAPicture
Message:

Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.

Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.

File:
1 edited

Legend:

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

    r38294 r38307  
    619619     * @param string $upload_iframe_src The upload iframe source URL by type.
    620620     */
    621     $upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src );
     621    $upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
    622622
    623623    return add_query_arg('TB_iframe', true, $upload_iframe_src);
     
    787787             * @param string $title Media title.
    788788             */
    789             $html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
     789            $html = apply_filters( "{$type}_send_to_editor_url", $html, esc_url_raw( $src ), $title );
    790790        } else {
    791791            $align = '';
Note: See TracChangeset for help on using the changeset viewer.