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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38307 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes
2016-08-22 18:24:48 +00:00
parent f9491ed8f6
commit b4fca4a558
21 changed files with 63 additions and 63 deletions

View File

@@ -618,7 +618,7 @@ function get_upload_iframe_src( $type = null, $post_id = null, $tab = null ) {
*
* @param string $upload_iframe_src The upload iframe source URL by type.
*/
$upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src );
$upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
return add_query_arg('TB_iframe', true, $upload_iframe_src);
}
@@ -786,7 +786,7 @@ function wp_media_upload_handler() {
* @param string $src Media source URL.
* @param string $title Media title.
*/
$html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
$html = apply_filters( "{$type}_send_to_editor_url", $html, esc_url_raw( $src ), $title );
} else {
$align = '';
$alt = esc_attr( wp_unslash( $_POST['alt'] ) );