Make WordPress Core

Ticket #37748: 37748.3.patch

File 37748.3.patch, 23.6 KB (added by ramiy, 9 years ago)
  • wp-admin/admin-footer.php

     
    8383 *
    8484 * @param string $hook_suffix The current admin page.
    8585 */
    86 do_action( "admin_print_footer_scripts-$hook_suffix" );
     86do_action( "admin_print_footer_scripts-{$hook_suffix}" );
    8787
    8888/**
    8989 * Prints any scripts and data queued for the footer.
     
    103103 * @global string $hook_suffix
    104104 * @param string $hook_suffix The current admin page.
    105105 */
    106 do_action( "admin_footer-$hook_suffix" );
     106do_action( "admin_footer-{$hook_suffix}" );
    107107
    108108// get_site_option() won't exist when auto upgrading from <= 2.7
    109109if ( function_exists('get_site_option') ) {
  • wp-admin/admin-header.php

     
    9696 *
    9797 * @since 2.6.0
    9898 */
    99 do_action( "admin_print_styles-$hook_suffix" );
     99do_action( "admin_print_styles-{$hook_suffix}" );
    100100
    101101/**
    102102 * Fires when styles are printed for all admin pages.
     
    110110 *
    111111 * @since 2.1.0
    112112 */
    113 do_action( "admin_print_scripts-$hook_suffix" );
     113do_action( "admin_print_scripts-{$hook_suffix}" );
    114114
    115115/**
    116116 * Fires when scripts are printed for all admin pages.
     
    127127 *
    128128 * @since 2.1.0
    129129 */
    130 do_action( "admin_head-$hook_suffix" );
     130do_action( "admin_head-{$hook_suffix}" );
    131131
    132132/**
    133133 * Fires in head section for all admin pages.
  • wp-admin/admin.php

     
    209209                 *
    210210                 * @since 2.1.0
    211211                 */
    212                 do_action( 'load-' . $page_hook );
     212                do_action( "load-{$page_hook}" );
    213213                if (! isset($_GET['noheader']))
    214214                        require_once(ABSPATH . 'wp-admin/admin-header.php');
    215215
     
    239239                 *
    240240                 * @since 1.5.0
    241241                 */
    242                 do_action( 'load-' . $plugin_page );
     242                do_action( "load-{$plugin_page}" );
    243243
    244244                if ( !isset($_GET['noheader']))
    245245                        require_once(ABSPATH . 'wp-admin/admin-header.php');
     
    278278         *
    279279         * @since 3.5.0
    280280         */
    281         do_action( 'load-importer-' . $importer );
     281        do_action( "load-importer-{$importer}" );
    282282
    283283        $parent_file = 'tools.php';
    284284        $submenu_file = 'import.php';
     
    326326         *
    327327         * @since 2.1.0
    328328         */
    329         do_action( 'load-' . $pagenow );
     329        do_action( "load-{$pagenow}" );
    330330
    331331        /*
    332332         * The following hooks are fired to ensure backward compatibility.
  • wp-admin/edit-form-advanced.php

     
    331331 *
    332332 * @param WP_Post $post Post object.
    333333 */
    334 do_action( 'add_meta_boxes_' . $post_type, $post );
     334do_action( "add_meta_boxes_{$post_type}", $post );
    335335
    336336/**
    337337 * Fires after meta boxes have been added.
  • wp-admin/includes/class-wp-automatic-updater.php

     
    176176                 * @param bool   $update Whether to update.
    177177                 * @param object $item   The update offer.
    178178                 */
    179                 $update = apply_filters( 'auto_update_' . $type, $update, $item );
     179                $update = apply_filters( "auto_update_{$type}", $update, $item );
    180180
    181181                if ( ! $update ) {
    182182                        if ( 'core' == $type )
  • wp-admin/includes/class-wp-ms-themes-list-table.php

     
    518518                 * @param WP_Theme $theme   The current WP_Theme object.
    519519                 * @param string   $context Status of the theme.
    520520                 */
    521                 $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, $context );
     521                $actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context );
    522522
    523523                echo $this->row_actions( $actions, true );
    524524        }
     
    726726                 * @param WP_Theme $theme      Current WP_Theme object.
    727727                 * @param string   $status     Status of the theme.
    728728                 */
    729                 do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status );
     729                do_action( "after_theme_row_{$stylesheet}", $stylesheet, $theme, $status );
    730730        }
    731731}
  • wp-admin/includes/class-wp-plugin-install-list-table.php

     
    200200                 *
    201201                 * @param array|bool $args Plugin Install API arguments.
    202202                 */
    203                 $args = apply_filters( "install_plugins_table_api_args_$tab", $args );
     203                $args = apply_filters( "install_plugins_table_api_args_{$tab}", $args );
    204204
    205205                if ( !$args )
    206206                        return;
  • wp-admin/includes/class-wp-plugins-list-table.php

     
    864864                 *                            'Inactive', 'Recently Activated', 'Upgrade', 'Must-Use',
    865865                 *                            'Drop-ins', 'Search'.
    866866                 */
    867                 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
     867                do_action( "after_plugin_row_{$plugin_file}", $plugin_file, $plugin_data, $status );
    868868        }
    869869
    870870        /**
  • wp-admin/includes/class-wp-theme-install-list-table.php

     
    134134                 *
    135135                 * @param array $args An array of themes API arguments.
    136136                 */
    137                 $args = apply_filters( 'install_themes_table_api_args_' . $tab, $args );
     137                $args = apply_filters( "install_themes_table_api_args_{$tab}", $args );
    138138
    139139                if ( ! $args )
    140140                        return;
  • wp-admin/includes/media.php

     
    619619         *
    620620         * @param string $upload_iframe_src The upload iframe source URL by type.
    621621         */
    622         $upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src );
     622        $upload_iframe_src = apply_filters( "{$type}_upload_iframe_src", $upload_iframe_src );
    623623
    624624        return add_query_arg('TB_iframe', true, $upload_iframe_src);
    625625}
     
    787787                         * @param string $src   Media source URL.
    788788                         * @param string $title Media title.
    789789                         */
    790                         $html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
     790                        $html = apply_filters( "{$type}_send_to_editor_url", $html, esc_url_raw( $src ), $title );
    791791                } else {
    792792                        $align = '';
    793793                        $alt = esc_attr( wp_unslash( $_POST['alt'] ) );
  • wp-admin/includes/plugin.php

     
    588588                         * @param bool $network_wide Whether to enable the plugin for all sites in the network
    589589                         *                           or just the current site. Multisite only. Default is false.
    590590                         */
    591                         do_action( 'activate_' . $plugin, $network_wide );
     591                        do_action( "activate_{$plugin}", $network_wide );
    592592                }
    593593
    594594                if ( $network_wide ) {
     
    701701                         * @param bool $network_deactivating Whether the plugin is deactivated for all sites in the network
    702702                         *                                   or just the current site. Multisite only. Default is false.
    703703                         */
    704                         do_action( 'deactivate_' . $plugin, $network_deactivating );
     704                        do_action( "deactivate_{$plugin}", $network_deactivating );
    705705
    706706                        /**
    707707                         * Fires after a plugin is deactivated.
  • wp-admin/includes/revision.php

     
    7070                 * @param string  null                  The context of whether the current revision is the old
    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(
    7979                        'show_split_view' => true
  • wp-admin/media-upload.php

     
    9595         *
    9696         * @since 2.5.0
    9797         */
    98         do_action( "media_upload_$type" );
     98        do_action( "media_upload_{$type}" );
    9999} else {
    100100        /**
    101101         * Fires inside limited and specific upload-tab views in the legacy
     
    107107         *
    108108         * @since 2.5.0
    109109         */
    110         do_action( "media_upload_$tab" );
     110        do_action( "media_upload_{$tab}" );
    111111}
    112112
  • wp-admin/plugin-install.php

     
    6464 *
    6565 * @since 2.7.0
    6666 */
    67 do_action( "install_plugins_pre_$tab" );
     67do_action( "install_plugins_pre_{$tab}" );
    6868
    6969/*
    7070 * Call the pre upload action on every non-upload plugin install screen
     
    155155 *
    156156 * @param int $paged The current page number of the plugins list table.
    157157 */
    158 do_action( "install_plugins_$tab", $paged ); ?>
     158do_action( "install_plugins_{$tab}", $paged ); ?>
    159159
    160160        <span class="spinner"></span>
    161161</div>
  • wp-includes/category-template.php

     
    12591259         *
    12601260         * @param array $links An array of term links.
    12611261         */
    1262         $term_links = apply_filters( "term_links-$taxonomy", $links );
     1262        $term_links = apply_filters( "term_links-{$taxonomy}", $links );
    12631263
    12641264        return $before . join( $sep, $term_links ) . $after;
    12651265}
  • wp-includes/class-wp-customize-control.php

     
    383383                 *
    384384                 * @param WP_Customize_Control $this WP_Customize_Control instance.
    385385                 */
    386                 do_action( 'customize_render_control_' . $this->id, $this );
     386                do_action( "customize_render_control_{$this->id}", $this );
    387387
    388388                $this->render();
    389389        }
  • wp-includes/class-wp-rewrite.php

     
    14131413                         *
    14141414                         * @param array $rules The rewrite rules generated for the current permastruct.
    14151415                         */
    1416                         $rules = apply_filters( $permastructname . '_rewrite_rules', $rules );
     1416                        $rules = apply_filters( "{$permastructname}_rewrite_rules", $rules );
    14171417                        if ( 'post_tag' == $permastructname ) {
    14181418
    14191419                                /**
  • wp-includes/option.php

     
    4949         *                               Default false to skip it.
    5050         * @param string     $option     Option name.
    5151         */
    52         $pre = apply_filters( 'pre_option_' . $option, false, $option );
     52        $pre = apply_filters( "pre_option_{$option}", false, $option );
    5353        if ( false !== $pre )
    5454                return $pre;
    5555
     
    7272                         *                        in the database.
    7373                         * @param string $option  Option name.
    7474                         */
    75                         return apply_filters( 'default_option_' . $option, $default, $option );
     75                        return apply_filters( "default_option_{$option}", $default, $option );
    7676                }
    7777
    7878                $alloptions = wp_load_alloptions();
     
    133133         *                       unserialized prior to being returned.
    134134         * @param string $option Option name.
    135135         */
    136         return apply_filters( 'option_' . $option, maybe_unserialize( $value ), $option );
     136        return apply_filters( "option_{$option}", maybe_unserialize( $value ), $option );
    137137}
    138138
    139139/**
     
    277277         * @param mixed  $old_value The old option value.
    278278         * @param string $option    Option name.
    279279         */
    280         $value = apply_filters( 'pre_update_option_' . $option, $value, $old_value, $option );
     280        $value = apply_filters( "pre_update_option_{$option}", $value, $old_value, $option );
    281281
    282282        /**
    283283         * Filters an option before its value is (maybe) serialized and updated.
     
    534534                 *
    535535                 * @param string $option Name of the deleted option.
    536536                 */
    537                 do_action( "delete_option_$option", $option );
     537                do_action( "delete_option_{$option}", $option );
    538538
    539539                /**
    540540                 * Fires after an option has been deleted.
     
    568568         *
    569569         * @param string $transient Transient name.
    570570         */
    571         do_action( 'delete_transient_' . $transient, $transient );
     571        do_action( "delete_transient_{$transient}", $transient );
    572572
    573573        if ( wp_using_ext_object_cache() ) {
    574574                $result = wp_cache_delete( $transient, 'transient' );
     
    624624         *                              of the transient, and return the returned value.
    625625         * @param string $transient     Transient name.
    626626         */
    627         $pre = apply_filters( 'pre_transient_' . $transient, false, $transient );
     627        $pre = apply_filters( "pre_transient_{$transient}", false, $transient );
    628628        if ( false !== $pre )
    629629                return $pre;
    630630
     
    661661         * @param mixed  $value     Value of transient.
    662662         * @param string $transient Transient name.
    663663         */
    664         return apply_filters( 'transient_' . $transient, $value, $transient );
     664        return apply_filters( "transient_{$transient}", $value, $transient );
    665665}
    666666
    667667/**
     
    696696         * @param int    $expiration Time until expiration in seconds.
    697697         * @param string $transient  Transient name.
    698698         */
    699         $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration, $transient );
     699        $value = apply_filters( "pre_set_transient_{$transient}", $value, $expiration, $transient );
    700700
    701701        /**
    702702         * Filters the expiration for a transient before its value is set.
     
    709709         * @param mixed  $value      New value of transient.
    710710         * @param string $transient  Transient name.
    711711         */
    712         $expiration = apply_filters( 'expiration_of_transient_' . $transient, $expiration, $value, $transient );
     712        $expiration = apply_filters( "expiration_of_transient_{$transient}", $expiration, $value, $transient );
    713713
    714714        if ( wp_using_ext_object_cache() ) {
    715715                $result = wp_cache_set( $transient, $value, 'transient', $expiration );
     
    758758                 * @param int    $expiration Time until expiration in seconds.
    759759                 * @param string $transient  The name of the transient.
    760760                 */
    761                 do_action( 'set_transient_' . $transient, $value, $expiration, $transient );
     761                do_action( "set_transient_{$transient}", $value, $expiration, $transient );
    762762
    763763                /**
    764764                 * Fires after the value for a transient has been set.
     
    11061106         * @param mixed  $pre_option The default value to return if the option does not exist.
    11071107         * @param string $option     Option name.
    11081108         */
    1109         $pre = apply_filters( 'pre_site_option_' . $option, false, $option );
     1109        $pre = apply_filters( "pre_site_option_{$option}", false, $option );
    11101110
    11111111        if ( false !== $pre ) {
    11121112                return $pre;
     
    11301130                 *                        in the database.
    11311131                 * @param string $option  Option name.
    11321132                 */
    1133                 return apply_filters( 'default_site_option_' . $option, $default, $option );
     1133                return apply_filters( "default_site_option_{$option}", $default, $option );
    11341134        }
    11351135
    11361136        if ( ! is_multisite() ) {
     
    11741174         * @param mixed  $value  Value of network option.
    11751175         * @param string $option Option name.
    11761176         */
    1177         return apply_filters( 'site_option_' . $option, $value, $option );
     1177        return apply_filters( "site_option_{$option}", $value, $option );
    11781178}
    11791179
    11801180/**
     
    12221222         * @param mixed  $value  Value of network option.
    12231223         * @param string $option Option name.
    12241224         */
    1225         $value = apply_filters( 'pre_add_site_option_' . $option, $value, $option );
     1225        $value = apply_filters( "pre_add_site_option_{$option}", $value, $option );
    12261226
    12271227        $notoptions_key = "$network_id:notoptions";
    12281228
     
    12711271                 * @param string $option Name of the network option.
    12721272                 * @param mixed  $value  Value of the network option.
    12731273                 */
    1274                 do_action( 'add_site_option_' . $option, $option, $value );
     1274                do_action( "add_site_option_{$option}", $option, $value );
    12751275
    12761276                /**
    12771277                 * Fires after a network option has been successfully added.
     
    13271327         *
    13281328         * @param string $option Option name.
    13291329         */
    1330         do_action( 'pre_delete_site_option_' . $option, $option );
     1330        do_action( "pre_delete_site_option_{$option}", $option );
    13311331
    13321332        if ( ! is_multisite() ) {
    13331333                $result = delete_option( $option );
     
    13541354                 *
    13551355                 * @param string $option Name of the network option.
    13561356                 */
    1357                 do_action( 'delete_site_option_' . $option, $option );
     1357                do_action( "delete_site_option_{$option}", $option );
    13581358
    13591359                /**
    13601360                 * Fires after a network option has been deleted.
     
    14171417         * @param mixed  $old_value Old value of the network option.
    14181418         * @param string $option    Option name.
    14191419         */
    1420         $value = apply_filters( 'pre_update_site_option_' . $option, $value, $old_value, $option );
     1420        $value = apply_filters( "pre_update_site_option_{$option}", $value, $old_value, $option );
    14211421
    14221422        if ( $value === $old_value ) {
    14231423                return false;
     
    14621462                 * @param mixed  $value     Current value of the network option.
    14631463                 * @param mixed  $old_value Old value of the network option.
    14641464                 */
    1465                 do_action( 'update_site_option_' . $option, $option, $value, $old_value );
     1465                do_action( "update_site_option_{$option}", $option, $value, $old_value );
    14661466
    14671467                /**
    14681468                 * Fires after the value of a network option has been successfully updated.
     
    15001500         *
    15011501         * @param string $transient Transient name.
    15021502         */
    1503         do_action( 'delete_site_transient_' . $transient, $transient );
     1503        do_action( "delete_site_transient_{$transient}", $transient );
    15041504
    15051505        if ( wp_using_ext_object_cache() ) {
    15061506                $result = wp_cache_delete( $transient, 'site-transient' );
     
    15571557         *                                   of the transient, and return the returned value.
    15581558         * @param string $transient          Transient name.
    15591559         */
    1560         $pre = apply_filters( 'pre_site_transient_' . $transient, false, $transient );
     1560        $pre = apply_filters( "pre_site_transient_{$transient}", false, $transient );
    15611561
    15621562        if ( false !== $pre )
    15631563                return $pre;
     
    15931593         * @param mixed  $value     Value of site transient.
    15941594         * @param string $transient Transient name.
    15951595         */
    1596         return apply_filters( 'site_transient_' . $transient, $value, $transient );
     1596        return apply_filters( "site_transient_{$transient}", $value, $transient );
    15971597}
    15981598
    15991599/**
     
    16251625         * @param mixed  $value     New value of site transient.
    16261626         * @param string $transient Transient name.
    16271627         */
    1628         $value = apply_filters( 'pre_set_site_transient_' . $transient, $value, $transient );
     1628        $value = apply_filters( "pre_set_site_transient_{$transient}", $value, $transient );
    16291629
    16301630        $expiration = (int) $expiration;
    16311631
     
    16401640         * @param mixed  $value      New value of site transient.
    16411641         * @param string $transient  Transient name.
    16421642         */
    1643         $expiration = apply_filters( 'expiration_of_site_transient_' . $transient, $expiration, $value, $transient );
     1643        $expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient );
    16441644
    16451645        if ( wp_using_ext_object_cache() ) {
    16461646                $result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
     
    16711671                 * @param int    $expiration Time until expiration in seconds.
    16721672                 * @param string $transient  Transient name.
    16731673                 */
    1674                 do_action( 'set_site_transient_' . $transient, $value, $expiration, $transient );
     1674                do_action( "set_site_transient_{$transient}", $value, $expiration, $transient );
    16751675
    16761676                /**
    16771677                 * Fires after the value for a site transient has been set.
  • wp-includes/taxonomy.php

     
    871871         * @param int|WP_Term $_term    Term object or ID.
    872872         * @param string      $taxonomy The taxonomy slug.
    873873         */
    874         $_term = apply_filters( "get_$taxonomy", $_term, $taxonomy );
     874        $_term = apply_filters( "get_{$taxonomy}", $_term, $taxonomy );
    875875
    876876        // Bail if a filter callback has changed the type of the `$_term` object.
    877877        if ( ! ( $_term instanceof WP_Term ) ) {
     
    19151915         *                              by the parent function. WP_Error otherwise.
    19161916         * @param array   $object_ids   List of term object IDs.
    19171917         */
    1918         do_action( "delete_$taxonomy", $term, $tt_id, $deleted_term, $object_ids );
     1918        do_action( "delete_{$taxonomy}", $term, $tt_id, $deleted_term, $object_ids );
    19191919
    19201920        return true;
    19211921}
     
    24062406         * @param int $term_id Term ID.
    24072407         * @param int $tt_id   Term taxonomy ID.
    24082408         */
    2409         do_action( "create_$taxonomy", $term_id, $tt_id );
     2409        do_action( "create_{$taxonomy}", $term_id, $tt_id );
    24102410
    24112411        /**
    24122412         * Filters the term ID after a new term is created.
     
    24422442         * @param int $term_id Term ID.
    24432443         * @param int $tt_id   Term taxonomy ID.
    24442444         */
    2445         do_action( "created_$taxonomy", $term_id, $tt_id );
     2445        do_action( "created_{$taxonomy}", $term_id, $tt_id );
    24462446
    24472447        return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
    24482448}
     
    29872987         * @param int $term_id Term ID.
    29882988         * @param int $tt_id   Term taxonomy ID.
    29892989         */
    2990         do_action( "edit_$taxonomy", $term_id, $tt_id );
     2990        do_action( "edit_{$taxonomy}", $term_id, $tt_id );
    29912991
    29922992        /** This filter is documented in wp-includes/taxonomy.php */
    29932993        $term_id = apply_filters( 'term_id_filter', $term_id, $tt_id );
     
    30163016         * @param int $term_id Term ID.
    30173017         * @param int $tt_id   Term taxonomy ID.
    30183018         */
    3019         do_action( "edited_$taxonomy", $term_id, $tt_id );
     3019        do_action( "edited_{$taxonomy}", $term_id, $tt_id );
    30203020
    30213021        return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id);
    30223022}
  • wp-includes/theme.php

     
    902902         * @param string $value     The new value of the theme mod.
    903903         * @param string $old_value The current value of the theme mod.
    904904         */
    905         $mods[ $name ] = apply_filters( "pre_set_theme_mod_$name", $value, $old_value );
     905        $mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
    906906
    907907        $theme = get_option( 'stylesheet' );
    908908        update_option( "theme_mods_$theme", $mods );
  • wp-login.php

     
    431431 *
    432432 * @since 2.8.0
    433433 */
    434 do_action( 'login_form_' . $action );
     434do_action( "login_form_{$action}" );
    435435
    436436$http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
    437437$interim_login = isset($_REQUEST['interim-login']);