Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.