Ticket #25442: 25442.2.diff
File 25442.2.diff, 6.5 KB (added by , 12 years ago) |
---|
-
src/wp-admin/admin.php
36 36 update_option( 'db_upgraded', false ); 37 37 38 38 /** 39 * Runs on the next page load after successful upgrade39 * Fires on the next page load after successful upgrade. 40 40 * 41 * @since 2.8 41 * @since 2.8.0 42 42 */ 43 do_action( 'after_db_upgrade');43 do_action( 'after_db_upgrade' ); 44 44 } elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) { 45 45 if ( !is_multisite() ) { 46 46 wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); 47 47 exit; 48 /** 49 * Filter whether to perform the Multisite upgrade routine. 50 * 51 * @since 3.0.0 52 * 53 * @param bool true Whether to perform the Multisite upgrade routine. Default true. 54 */ 48 55 } elseif ( apply_filters( 'do_mu_upgrade', true ) ) { 49 56 /** 50 57 * On really small MU installs run the upgrader every time, … … 57 64 if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) { 58 65 require_once( ABSPATH . WPINC . '/http.php' ); 59 66 $response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) ); 67 /** 68 * Fires after the Multisite upgrade is complete. 69 * 70 * @since 3.0.0 71 * 72 * @param array|WP_Error $response The upgrade response array or WP_Error on failure. 73 */ 60 74 do_action( 'after_mu_upgrade', $response ); 61 75 unset($response); 62 76 } … … 103 117 else 104 118 require(ABSPATH . 'wp-admin/menu.php'); 105 119 106 if ( current_user_can( 'manage_options' ) ) 120 if ( current_user_can( 'manage_options' ) ) { 121 /** 122 * Filter the maximum memory limit available for administration screens. 123 * 124 * The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory limit available 125 * when in the administration back-end. The default is 256M, or 256 megabytes of memory. 126 * 127 * @since 3.0.0 128 * 129 * @param string 'WP_MAX_MEMORY_LIMIT' The maximum WordPress memory limit. Default 256M. 130 */ 107 131 @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) ); 132 } 108 133 109 do_action('admin_init'); 134 /** 135 * Fires at the beginning of any admin page, before the page is rendered. 136 * 137 * @since 2.5.0 138 */ 139 do_action( 'admin_init' ); 110 140 111 141 if ( isset($plugin_page) ) { 112 142 if ( !empty($typenow) ) … … 142 172 // Handle plugin admin pages. 143 173 if ( isset($plugin_page) ) { 144 174 if ( $page_hook ) { 145 do_action('load-' . $page_hook); 175 /** 176 * Fires before a plugin page is loaded where $page_hook is not empty. 177 * 178 * The dynamic portion of the hook name, $page_hook, refers to a mixture of plugin 179 * page information including: 180 * 1. The page type. If the plugin page is registered as a submenu page, such as for 181 * Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'. 182 * 2. A separator of '_page_'. 183 * 3. The plugin basename minus the file extension. 184 * 185 * Together, the three parts form the $page_hook. Citing the example above, 186 * the hook name used would be 'load-settings_page_pluginbasename'. 187 * 188 * @see get_plugin_page_hook() 189 * 190 * @since 2.1.0 191 */ 192 do_action( 'load-' . $page_hook ); 146 193 if (! isset($_GET['noheader'])) 147 194 require_once(ABSPATH . 'wp-admin/admin-header.php'); 148 195 149 do_action($page_hook); 196 /** 197 * Fires after the admin header is loaded for a plugin page where $page_hook is not empty. 198 * 199 * The dynamic hook name, $page_hook, refers to a mixture of plugin page information including: 200 * 1. The page type. If the plugin page is registered as a submenu page, such as for Settings, 201 * the page type would be 'settings'. Otherwise the type is 'toplevel'. 202 * 2. A separator of '_page_'. 203 * 3. The plugin basename minus the file extension. 204 * 205 * Together, the three parts form the $page_hook. Citing the example above, 206 * the hook name used would be 'load-settings_page_pluginbasename'. 207 * 208 * @since 1.5.0 209 */ 210 do_action( $page_hook ); 150 211 } else { 151 212 if ( validate_file($plugin_page) ) 152 213 wp_die(__('Invalid plugin page')); … … 154 215 if ( !( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) && !( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") && is_file(WPMU_PLUGIN_DIR . "/$plugin_page") ) ) 155 216 wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); 156 217 157 do_action('load-' . $plugin_page); 218 /** 219 * Fires before a plugin page is loaded where $page_hook is empty. 220 * 221 * The dynamic portion of the hook name, $plugin_page, refers to the plugin basename. 222 * 223 * @see plugin_basename() 224 * 225 * @since 1.5.0 226 */ 227 do_action( 'load-' . $plugin_page ); 158 228 159 229 if ( !isset($_GET['noheader'])) 160 230 require_once(ABSPATH . 'wp-admin/admin-header.php'); … … 185 255 exit; 186 256 } 187 257 258 /** 259 * Fires before an importer page is loaded. 260 * 261 * The dynamic portion of the hook name, $importer, refers to the importer slug. 262 * 263 * @since 3.5.0 264 */ 188 265 do_action( 'load-importer-' . $importer ); 189 266 190 267 $parent_file = 'tools.php'; … … 198 275 199 276 define('WP_IMPORTING', true); 200 277 278 /** 279 * Whether to filter imported data through kses on import. 280 * 281 * In Multisite, imported data is filtered through kses by default 282 * by filtering on this hook and returning true. 283 * 284 * @since 3.1.0 285 * 286 * @param bool false Whether to force data to be filtered through kses. Default false. 287 */ 201 288 if ( apply_filters( 'force_filtered_html_on_import', false ) ) 202 289 kses_init_filters(); // Always filter imported data with kses on multisite. 203 290 … … 210 297 211 298 exit(); 212 299 } else { 213 do_action("load-$pagenow"); 300 /** 301 * Fires before an admin page is loaded. 302 * 303 * The dynamic portion of the hook name, $pagenow, is a global variable 304 * referring to the filename of the current page, such as 'admin.php', 305 * 'post-new.php' etc. A complete hook for the latter would be 'load-post-new.php'. 306 * 307 * @since 2.1.0 308 */ 309 do_action( 'load-' . $pagenow ); 214 310 // Backwards compatibility with old load-page-new.php, load-page.php, 215 311 // and load-categories.php actions. 216 312 if ( $typenow == 'page' ) { … … 226 322 } 227 323 } 228 324 229 if ( !empty($_REQUEST['action']) ) 325 if ( !empty($_REQUEST['action']) ) { 326 /** 327 * Fires before the page loads for the requested action. 328 * 329 * The dynamic portion of the hook name, $_REQUEST['action'], refers to the action 330 * derived from the $_REQUEST super global passed to admin.php. 331 * 332 * @since 2.6.0 333 */ 230 334 do_action('admin_action_' . $_REQUEST['action']); 335 }