~canonical-sysadmins/wordpress/4.7.1

« back to all changes in this revision

Viewing changes to wp-admin/admin.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                exit;
49
49
 
50
50
        /**
51
 
         * Filter whether to attempt to perform the multisite DB upgrade routine.
 
51
         * Filters whether to attempt to perform the multisite DB upgrade routine.
52
52
         *
53
53
         * In single site, the user would be redirected to wp-admin/upgrade.php.
54
54
         * In multisite, the DB upgrade routine is automatically fired, but only
138
138
        require(ABSPATH . 'wp-admin/menu.php');
139
139
 
140
140
if ( current_user_can( 'manage_options' ) ) {
141
 
        /**
142
 
         * Filter the maximum memory limit available for administration screens.
143
 
         *
144
 
         * This only applies to administrators, who may require more memory for tasks like updates.
145
 
         * Memory limits when processing images (uploaded or edited by users of any role) are
146
 
         * handled separately.
147
 
         *
148
 
         * The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory limit available
149
 
         * when in the administration back end. The default is 256M, or 256 megabytes of memory.
150
 
         *
151
 
         * @since 3.0.0
152
 
         *
153
 
         * @param string 'WP_MAX_MEMORY_LIMIT' The maximum WordPress memory limit. Default 256M.
154
 
         */
155
 
        @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
 
141
        wp_raise_memory_limit( 'admin' );
156
142
}
157
143
 
158
144
/**
161
147
 * Note, this does not just run on user-facing admin screens.
162
148
 * It runs on admin-ajax.php and admin-post.php as well.
163
149
 *
164
 
 * This is roughly analogous to the more general 'init' hook, which fires earlier.
 
150
 * This is roughly analogous to the more general {@see 'init'} hook, which fires earlier.
165
151
 *
166
152
 * @since 2.5.0
167
153
 */
175
161
        if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) {
176
162
                $page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
177
163
 
178
 
                // Backwards compatibility for plugins using add_management_page().
 
164
                // Back-compat for plugins using add_management_page().
179
165
                if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
180
166
                        // There could be plugin specific params on the URL, so we need the whole query string
181
167
                        if ( !empty($_SERVER[ 'QUERY_STRING' ]) )
271
257
 
272
258
        $importer = $_GET['import'];
273
259
 
274
 
        if ( ! current_user_can('import') )
275
 
                wp_die(__('You are not allowed to import.'));
 
260
        if ( ! current_user_can( 'import' ) ) {
 
261
                wp_die( __( 'Sorry, you are not allowed to import content.' ) );
 
262
        }
276
263
 
277
264
        if ( validate_file($importer) ) {
278
265
                wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );