WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/22/2016 06:24:48 PM (4 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/revision.php

    r37488 r38307  
    7171         *                                      or the new one. Values are 'to' or 'from'.
    7272         */
    73         $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : '';
     73        $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
    7474
    7575        /** This filter is documented in wp-admin/includes/revision.php */
    76         $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' );
     76        $content_to = apply_filters( "_wp_post_revision_field_{$field}", $compare_to->$field, $field, $compare_to, 'to' );
    7777
    7878        $args = array(
Note: See TracChangeset for help on using the changeset viewer.