wppaste
WordPress

apply_filters( "{$context}_memory_limit", int|string $filtered_limit )

Since
4.6.0
Filters the memory limit allocated for an arbitrary context.

Description

The dynamic portion of the hook name, $context, refers to an arbitrary context passed on calling the function. This allows for plugins to define their own contexts for raising the memory limit.

Compatibility

WordPress
since 4.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$filtered_limitint|string
Maximum memory limit to allocate for this context.
Default WP_MAX_MEMORY_LIMITor the original php.inimemory_limit`, whichever is higher. Accepts an integer (bytes), or a shorthand string notation, such as '256M'.

Where this hook fires · 1

  • wp-includes/functions.php:7908wp_raise_memory_limit()

Source code

			 *			 * @param int|string $filtered_limit Maximum memory limit to allocate for this context.			 *                                   Default WP_MAX_MEMORY_LIMIT` or the original php.ini `memory_limit`,			 *                                   whichever is higher. Accepts an integer (bytes), or a			 *                                   shorthand string notation, such as '256M'.			 */			$filtered_limit = apply_filters( "{$context}_memory_limit", $filtered_limit );			break;	} 	$filtered_limit_int = wp_convert_hr_to_bytes( $filtered_limit ); 	if ( -1 === $filtered_limit_int || ( $filtered_limit_int > $wp_max_limit_int && $filtered_limit_int > $current_limit_int ) ) {

Changelog

Introduced in 4.6.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.