Make WordPress Core

Changeset 32653


Ignore:
Timestamp:
05/29/2015 05:03:13 PM (10 years ago)
Author:
wonderboymusic
Message:

In the style of #30947 and default-filters.php, add 2 new files to wp-admin/includes:
admin-filters.php
ms-admin-filters.php

There are random actions and filters littered among files like misc.php. These files contain functions that won't work outside of admin context and are typically only loaded in files that have already loaded the admin bootstrap.

See #32529.

Location:
trunk/src/wp-admin/includes
Files:
2 added
16 edited

Legend:

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

    r29206 r32653  
    1515    load_textdomain( 'default', WP_LANG_DIR . '/admin-' . get_locale() . '.mo' );
    1616}
     17
     18/** WordPress Administration Hooks */
     19require_once(ABSPATH . 'wp-admin/includes/admin-filters.php');
    1720
    1821/** WordPress Bookmark Administration API */
     
    7073/** WordPress Multisite support API */
    7174if ( is_multisite() ) {
     75    require_once(ABSPATH . 'wp-admin/includes/ms-admin-filters.php');
    7276    require_once(ABSPATH . 'wp-admin/includes/ms.php');
    7377    require_once(ABSPATH . 'wp-admin/includes/ms-deprecated.php');
  • trunk/src/wp-admin/includes/bookmark.php

    r32642 r32653  
    117117 */
    118118function wp_get_link_cats( $link_id = 0 ) {
    119 
    120119    $cats = wp_get_object_terms( $link_id, 'link_category', array('fields' => 'ids') );
    121 
    122120    return array_unique( $cats );
    123121}
     
    309307    wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );
    310308}
    311 add_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' );
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r32650 r32653  
    16251625}
    16261626
    1627 add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
    1628 
    16291627/**
    16301628 * Language pack upgrader, for updating translations of plugins, themes, and core.
  • trunk/src/wp-admin/includes/dashboard.php

    r32642 r32653  
    11981198    <?php
    11991199}
    1200 add_action( 'activity_box_end', 'wp_dashboard_quota' );
    12011200
    12021201// Display Browser Nag Meta Box
  • trunk/src/wp-admin/includes/media.php

    r32650 r32653  
    6464    return $tabs;
    6565}
    66 add_filter('media_upload_tabs', 'update_gallery_tab');
    6766
    6867/**
     
    221220    return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
    222221}
    223 add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 );
    224222
    225223/**
     
    578576    }
    579577}
    580 add_action( 'media_buttons', 'media_buttons' );
    581578
    582579/**
     
    11421139}
    11431140
    1144 add_filter( 'attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2 );
    1145 
    11461141/**
    11471142 * {@internal Missing Short Description}}
     
    11681163    return $html;
    11691164}
    1170 
    1171 add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3);
    11721165
    11731166/**
     
    26122605    <?php
    26132606}
    2614 add_action('post-plupload-upload-ui', 'media_upload_flash_bypass');
    26152607
    26162608/**
     
    26262618    <?php
    26272619}
    2628 add_action('post-html-upload-ui', 'media_upload_html_bypass');
    26292620
    26302621/**
     
    29082899    endif;
    29092900}
    2910 
    2911 add_filter( 'async_upload_image', 'get_media_item', 10, 2 );
    2912 add_filter( 'async_upload_audio', 'get_media_item', 10, 2 );
    2913 add_filter( 'async_upload_video', 'get_media_item', 10, 2 );
    2914 add_filter( 'async_upload_file',  'get_media_item', 10, 2 );
    2915 
    2916 add_action( 'media_upload_image', 'wp_media_upload_handler' );
    2917 add_action( 'media_upload_audio', 'wp_media_upload_handler' );
    2918 add_action( 'media_upload_video', 'wp_media_upload_handler' );
    2919 add_action( 'media_upload_file',  'wp_media_upload_handler' );
    2920 
    2921 add_filter( 'media_upload_gallery', 'media_upload_gallery' );
    2922 add_filter( 'media_upload_library', 'media_upload_library' );
    2923 
    2924 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
    29252901
    29262902/**
  • trunk/src/wp-admin/includes/misc.php

    r32642 r32653  
    251251}
    252252
    253 add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
    254 add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
    255 add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
    256 
    257253/**
    258254 * Shorten an URL, to be used as link text
     
    680676    echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n";
    681677}
    682 add_action( 'admin_head', 'wp_color_scheme_settings' );
    683678
    684679function _ipad_meta() {
     
    689684    }
    690685}
    691 add_action('admin_head', '_ipad_meta');
    692686
    693687/**
     
    720714    return $response;
    721715}
    722 add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );
    723716
    724717/**
     
    759752    return $response;
    760753}
    761 add_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );
    762754
    763755/**
     
    793785    return $response;
    794786}
    795 add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
    796787
    797788/**
     
    814805    return $settings;
    815806}
    816 add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
    817807
    818808/**
     
    839829    return $response;
    840830}
    841 // Run later as we have to set DOING_AUTOSAVE for back-compat
    842 add_filter( 'heartbeat_received', 'heartbeat_autosave', 500, 2 );
    843831
    844832/**
     
    859847    }
    860848}
    861 add_action( 'post_edit_form_tag', 'post_form_autocomplete_off' );
    862849
    863850/**
     
    904891<?php
    905892}
    906 add_action( 'admin_head', 'wp_admin_canonical_url' );
  • trunk/src/wp-admin/includes/ms.php

    r32642 r32653  
    4242    return $file;
    4343}
    44 add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
    4544
    4645/**
     
    301300    wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
    302301}
    303 add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    304 add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    305302
    306303/**
     
    384381    }
    385382}
    386 add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
    387383
    388384/**
     
    396392        echo "<div class='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "</div>";
    397393}
    398 add_action( 'admin_notices', 'new_user_email_admin_notice' );
    399394
    400395/**
     
    491486    <?php
    492487}
    493 add_action( 'wpmueditblogaction', 'upload_space_setting' );
    494488
    495489/**
     
    622616    return $term;
    623617}
    624 add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
    625618
    626619/**
     
    663656    wp_die( $output, 403 );
    664657}
    665 add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
    666658
    667659/**
     
    678670    return true;
    679671}
    680 add_filter( 'import_allow_create_users', 'check_import_new_users' );
    681672// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
    682673
     
    747738        echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
    748739}
    749 add_action( 'admin_notices', 'site_admin_notice' );
    750 add_action( 'network_admin_notices', 'site_admin_notice' );
    751740
    752741/**
     
    783772    return $data;
    784773}
    785 add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
    786774
    787775/**
  • trunk/src/wp-admin/includes/nav-menu.php

    r32642 r32653  
    12551255        wp_delete_post( $menu_item_id, true );
    12561256}
    1257 add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items');
    12581257
    12591258/**
  • trunk/src/wp-admin/includes/plugin-install.php

    r32642 r32653  
    159159    echo '</p><br class="clear" />';
    160160}
    161 add_action( 'install_plugins_featured', 'install_dashboard' );
    162161
    163162/**
     
    210209<?php
    211210}
    212 add_action('install_plugins_upload', 'install_plugins_upload' );
    213211
    214212/**
     
    259257    <?php
    260258}
    261 add_action( 'install_plugins_search',      'display_plugins_table' );
    262 add_action( 'install_plugins_popular',     'display_plugins_table' );
    263 add_action( 'install_plugins_recommended', 'display_plugins_table' );
    264 add_action( 'install_plugins_new',         'display_plugins_table' );
    265 add_action( 'install_plugins_beta',        'display_plugins_table' );
    266 add_action( 'install_plugins_favorites',   'display_plugins_table' );
    267259
    268260/**
     
    583575    exit;
    584576}
    585 add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
  • trunk/src/wp-admin/includes/plugin.php

    r32643 r32653  
    18531853    return $options;
    18541854}
    1855 add_filter( 'whitelist_options', 'option_update_filter' );
    18561855
    18571856/**
  • trunk/src/wp-admin/includes/template.php

    r32650 r32653  
    21872187}
    21882188
    2189 add_action( 'admin_enqueue_scripts', array( 'WP_Internal_Pointers', 'enqueue_scripts'                ) );
    2190 add_action( 'user_register',         array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
    2191 
    21922189/**
    21932190 * Convert a screen string to a screen object
  • trunk/src/wp-admin/includes/theme-install.php

    r32643 r32653  
    133133<?php
    134134}
    135 // add_action('install_themes_dashboard', 'install_themes_dashboard');
    136135
    137136function install_themes_upload() {
     
    145144    <?php
    146145}
    147 // add_action('install_themes_upload', 'install_themes_upload', 10, 0);
    148146
    149147/**
     
    181179
    182180}
    183 // add_action('install_themes_search', 'display_themes');
    184 // add_action('install_themes_featured', 'display_themes');
    185 // add_action('install_themes_new', 'display_themes');
    186 // add_action('install_themes_updated', 'display_themes');
    187181
    188182/**
     
    209203    exit;
    210204}
    211 add_action('install_themes_pre_theme-information', 'install_theme_information');
  • trunk/src/wp-admin/includes/theme.php

    r32650 r32653  
    566566    <?php
    567567}
    568 add_action( 'customize_controls_print_footer_scripts', 'customize_themes_print_templates' );
  • trunk/src/wp-admin/includes/update-core.php

    r32643 r32653  
    12111211    exit();
    12121212}
    1213 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
    12141213
    12151214/**
  • trunk/src/wp-admin/includes/update.php

    r32643 r32653  
    189189    }
    190190}
    191 add_filter( 'update_footer', 'core_update_footer' );
    192191
    193192/**
     
    217216    echo "<div class='update-nag'>$msg</div>";
    218217}
    219 add_action( 'admin_notices', 'update_nag', 3 );
    220 add_action( 'network_admin_notices', 'update_nag', 3 );
    221218
    222219// Called directly from dashboard
     
    267264    }
    268265}
    269 add_action( 'admin_init', 'wp_plugin_update_rows' );
    270266
    271267function wp_plugin_update_row( $file, $plugin_data ) {
     
    363359    }
    364360}
    365 add_action( 'admin_init', 'wp_theme_update_rows' );
    366361
    367362function wp_theme_update_row( $theme_key, $theme ) {
     
    442437    echo "<div class='update-nag'>$msg</div>";
    443438}
    444 add_action( 'admin_notices', 'maintenance_nag' );
    445 add_action( 'network_admin_notices', 'maintenance_nag' );
  • trunk/src/wp-admin/includes/user.php

    r32642 r32653  
    387387}
    388388
    389 add_action('admin_init', 'default_password_nag_handler');
    390389/**
    391390 * @since 2.8.0
     
    410409}
    411410
    412 add_action('profile_update', 'default_password_nag_edit_user', 10, 2);
    413 
    414411/**
    415412 * @since 2.8.0
     
    428425    }
    429426}
    430 
    431 add_action('admin_notices', 'default_password_nag');
    432427
    433428/**
Note: See TracChangeset for help on using the changeset viewer.