admin_memory_limit filter-hookWP 3.0.0

Filters the maximum memory limit available for administration screens.

This only applies to administrators, who may require more memory for tasks like updates. Memory limits when processing images (uploaded or edited by users of any role) are handled separately.

The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory limit available when in the administration back end. The default is 256M (256 megabytes of memory) or the original memory_limit php.ini value if this is higher.

Usage

add_filter( 'admin_memory_limit', 'wp_kama_admin_memory_limit_filter' );

/**
 * Function for `admin_memory_limit` filter-hook.
 * 
 * @param int|string $filtered_limit The maximum WordPress memory limit. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
 *
 * @return int|string
 */
function wp_kama_admin_memory_limit_filter( $filtered_limit ){

	// filter...
	return $filtered_limit;
}
$filtered_limit(int|string)
The maximum WordPress memory limit. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.

Changelog

Since 3.0.0 Introduced.
Since 4.6.0 The default now takes the original memory_limit into account.

Where the hook is called

wp_raise_memory_limit()
admin_memory_limit
wp-includes/functions.php 7693
$filtered_limit = apply_filters( 'admin_memory_limit', $filtered_limit );

Where the hook is used in WordPress

Usage not found.