Make WordPress Core

Changeset 16365


Ignore:
Timestamp:
11/14/2010 03:50:02 PM (14 years ago)
Author:
scribu
Message:

Improve hook readability via curly brackets. Props jjj for initial patch. Fixes #15422

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-terms-list-table.php

    r16254 r16365  
    251251
    252252        $actions = apply_filters( 'tag_row_actions', $actions, $tag );
    253         $actions = apply_filters( "${taxonomy}_row_actions", $actions, $tag );
     253        $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
    254254
    255255        $out .= $this->row_actions( $actions );
  • trunk/wp-admin/includes/post.php

    r16174 r16365  
    10231023        if ( !empty($uri) )
    10241024            $uri .= '/';
    1025         $permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
     1025        $permalink = str_replace('%pagename%', "{$uri}%pagename%", $permalink);
    10261026    }
    10271027
  • trunk/wp-admin/includes/widgets.php

    r16313 r16365  
    9999    $hidden = isset($params[0]['_hide']) ? ' style="display:none;"' : '';
    100100
    101     $params[0]['before_widget'] = "<div id='widget-${i}_$id' class='widget'$hidden>";
     101    $params[0]['before_widget'] = "<div id='widget-{$i}_{$id}' class='widget'$hidden>";
    102102    $params[0]['after_widget'] = "</div>";
    103103    $params[0]['before_title'] = "%BEG_OF_TITLE%"; // deprecated
  • trunk/wp-includes/comment.php

    r16357 r16365  
    11621162    if ( $new_status != $old_status ) {
    11631163        do_action('transition_comment_status', $new_status, $old_status, $comment);
    1164         do_action("comment_${old_status}_to_$new_status", $comment);
    1165     }
    1166     do_action("comment_${new_status}_$comment->comment_type", $comment->comment_ID, $comment);
     1164        do_action("comment_{$old_status}_to_{$new_status}", $comment);
     1165    }
     1166    do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
    11671167}
    11681168
  • trunk/wp-includes/functions.php

    r16340 r16365  
    42274227
    42284228    if ( $context != '' ) {
    4229         $extra_headers = apply_filters( "extra_$context".'_headers', array() );
     4229        $extra_headers = apply_filters( "extra_{$context}".'_headers', array() );
    42304230
    42314231        $extra_headers = array_flip( $extra_headers );
  • trunk/wp-includes/general-template.php

    r16303 r16365  
    11221122        $thisyear = ''.intval(substr($m, 0, 4));
    11231123        $d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
    1124         $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
     1124        $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
    11251125    } elseif ( !empty($m) ) {
    11261126        $thisyear = ''.intval(substr($m, 0, 4));
  • trunk/wp-includes/post.php

    r16338 r16365  
    16091609 *
    16101610 * @since 2.3.0
    1611  * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and
     1611 * @uses apply_filters() Calls 'edit_$field' and '{$field_no_prefix}_edit_pre' passing $value and
    16121612 *  $post_id if $context == 'edit' and field name prefix == 'post_'.
    16131613 *
    16141614 * @uses apply_filters() Calls 'edit_post_$field' passing $value and $post_id if $context == 'db'.
    16151615 * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'post_'.
    1616  * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'post_'.
     1616 * @uses apply_filters() Calls '{$field}_pre' passing $value if $context == 'db' and field name prefix != 'post_'.
    16171617 *
    16181618 * @uses apply_filters() Calls '$field' passing $value, $post_id and $context if $context == anything
     
    16531653
    16541654        if ( $prefixed ) {
    1655             $value = apply_filters("edit_$field", $value, $post_id);
     1655            $value = apply_filters("edit_{$field}", $value, $post_id);
    16561656            // Old school
    1657             $value = apply_filters("${field_no_prefix}_edit_pre", $value, $post_id);
     1657            $value = apply_filters("{$field_no_prefix}_edit_pre", $value, $post_id);
    16581658        } else {
    1659             $value = apply_filters("edit_post_$field", $value, $post_id);
     1659            $value = apply_filters("edit_post_{$field}", $value, $post_id);
    16601660        }
    16611661
     
    16701670    } else if ( 'db' == $context ) {
    16711671        if ( $prefixed ) {
    1672             $value = apply_filters("pre_$field", $value);
    1673             $value = apply_filters("${field_no_prefix}_save_pre", $value);
     1672            $value = apply_filters("pre_{$field}", $value);
     1673            $value = apply_filters("{$field_no_prefix}_save_pre", $value);
    16741674        } else {
    1675             $value = apply_filters("pre_post_$field", $value);
    1676             $value = apply_filters("${field}_pre", $value);
     1675            $value = apply_filters("pre_post_{$field}", $value);
     1676            $value = apply_filters("{$field}_pre", $value);
    16771677        }
    16781678    } else {
     
    16811681            $value = apply_filters($field, $value, $post_id, $context);
    16821682        else
    1683             $value = apply_filters("post_$field", $value, $post_id, $context);
     1683            $value = apply_filters("post_{$field}", $value, $post_id, $context);
    16841684    }
    16851685
     
    29242924 * @uses do_action() Calls 'transition_post_status' on $new_status, $old_status and
    29252925 *  $post if there is a status change.
    2926  * @uses do_action() Calls '${old_status}_to_$new_status' on $post if there is a status change.
    2927  * @uses do_action() Calls '${new_status}_$post->post_type' on post ID and $post.
     2926 * @uses do_action() Calls '{$old_status}_to_{$new_status}' on $post if there is a status change.
     2927 * @uses do_action() Calls '{$new_status}_{$post->post_type}' on post ID and $post.
    29282928 *
    29292929 * @param string $new_status Transition to this post status.
     
    29332933function wp_transition_post_status($new_status, $old_status, $post) {
    29342934    do_action('transition_post_status', $new_status, $old_status, $post);
    2935     do_action("${old_status}_to_$new_status", $post);
    2936     do_action("${new_status}_$post->post_type", $post->ID, $post);
     2935    do_action("{$old_status}_to_{$new_status}", $post);
     2936    do_action("{$new_status}_{$post->post_type}", $post->ID, $post);
    29372937}
    29382938
  • trunk/wp-includes/taxonomy.php

    r16322 r16365  
    13841384
    13851385    if ( 'edit' == $context ) {
    1386         $value = apply_filters("edit_term_$field", $value, $term_id, $taxonomy);
    1387         $value = apply_filters("edit_${taxonomy}_$field", $value, $term_id);
     1386        $value = apply_filters("edit_term_{$field}", $value, $term_id, $taxonomy);
     1387        $value = apply_filters("edit_{$taxonomy}_{$field}", $value, $term_id);
    13881388        if ( 'description' == $field )
    13891389            $value = format_to_edit($value);
     
    13911391            $value = esc_attr($value);
    13921392    } else if ( 'db' == $context ) {
    1393         $value = apply_filters("pre_term_$field", $value, $taxonomy);
    1394         $value = apply_filters("pre_${taxonomy}_$field", $value);
     1393        $value = apply_filters("pre_term_{$field}", $value, $taxonomy);
     1394        $value = apply_filters("pre_{$taxonomy}_{$field}", $value);
    13951395        // Back compat filters
    13961396        if ( 'slug' == $field )
     
    13981398
    13991399    } else if ( 'rss' == $context ) {
    1400         $value = apply_filters("term_${field}_rss", $value, $taxonomy);
    1401         $value = apply_filters("${taxonomy}_${field}_rss", $value);
     1400        $value = apply_filters("term_{$field}_rss", $value, $taxonomy);
     1401        $value = apply_filters("{$taxonomy}_{$field}_rss", $value);
    14021402    } else {
    14031403        // Use display filters by default.
    1404         $value = apply_filters("term_$field", $value, $term_id, $taxonomy, $context);
    1405         $value = apply_filters("${taxonomy}_$field", $value, $term_id, $context);
     1404        $value = apply_filters("term_{$field}", $value, $term_id, $taxonomy, $context);
     1405        $value = apply_filters("{$taxonomy}_{$field}", $value, $term_id, $context);
    14061406    }
    14071407
  • trunk/wp-includes/user.php

    r16353 r16365  
    11491149 *
    11501150 * @since 2.3.0
    1151  * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and
     1151 * @uses apply_filters() Calls 'edit_$field' and '{$field_no_prefix}_edit_pre' passing $value and
    11521152 *  $user_id if $context == 'edit' and field name prefix == 'user_'.
    11531153 *
    11541154 * @uses apply_filters() Calls 'edit_user_$field' passing $value and $user_id if $context == 'db'.
    11551155 * @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'user_'.
    1156  * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'.
     1156 * @uses apply_filters() Calls '{$field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'.
    11571157 *
    11581158 * @uses apply_filters() Calls '$field' passing $value, $user_id and $context if $context == anything
     
    11871187    if ( 'edit' == $context ) {
    11881188        if ( $prefixed ) {
    1189             $value = apply_filters("edit_$field", $value, $user_id);
     1189            $value = apply_filters("edit_{$field}", $value, $user_id);
    11901190        } else {
    1191             $value = apply_filters("edit_user_$field", $value, $user_id);
     1191            $value = apply_filters("edit_user_{$field}", $value, $user_id);
    11921192        }
    11931193
     
    11981198    } else if ( 'db' == $context ) {
    11991199        if ( $prefixed ) {
    1200             $value = apply_filters("pre_$field", $value);
     1200            $value = apply_filters("pre_{$field}", $value);
    12011201        } else {
    1202             $value = apply_filters("pre_user_$field", $value);
     1202            $value = apply_filters("pre_user_{$field}", $value);
    12031203        }
    12041204    } else {
     
    12071207            $value = apply_filters($field, $value, $user_id, $context);
    12081208        else
    1209             $value = apply_filters("user_$field", $value, $user_id, $context);
     1209            $value = apply_filters("user_{$field}", $value, $user_id, $context);
    12101210    }
    12111211
Note: See TracChangeset for help on using the changeset viewer.