WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/14/2016 04:17:38 AM (4 years ago)
Author:
johnbillion
Message:

General: Use interpolation instead of concatenation for all dynamic hook names.

This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-comments.php

    r39552 r39600  
    8484
    8585    if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) {
     86        $screen = get_current_screen()->id;
     87
    8688        /**
    8789         * Fires when a custom bulk action should be handled.
     
    8991         * The redirect link should be modified with success or failure feedback
    9092         * from the action to be used to display feedback to the user.
     93         *
     94         * The dynamic portion of the hook name, `$screen`, refers to the current screen ID.
    9195         *
    9296         * @since 4.7.0
     
    96100         * @param array  $items        The items to take the action on.
    97101         */
    98         $redirect_to = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $comment_ids );
     102        $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids );
    99103    }
    100104
Note: See TracChangeset for help on using the changeset viewer.