Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: {$context}_memory_limit

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
5435                 * their own contexts for raising the memory limit.
5436                 *
5437                 * @since 4.6.0
5438                 *
5439                 * @param int|string $filtered_limit Maximum memory limit to allocate for images.
5440                 *                                   Default '256M' or the original php.ini `memory_limit`,
5441                 *                                   whichever is higher. Accepts an integer (bytes), or a
5442                 *                                   shorthand string notation, such as '256M'.
5443                 */
5444                $filtered_limit = apply_filters( "{$context}_memory_limit", $filtered_limit );
5445                break;
5446      }
5447
5448      $filtered_limit_int = wp_convert_hr_to_bytes( $filtered_limit );
5449
5450      if ( -1 === $filtered_limit_int || ( $filtered_limit_int > $wp_max_limit_int && $filtered_limit_int > $current_limit_int ) ) {
5451           if ( false !== @ini_set( 'memory_limit', $filtered_limit ) ) {
5452                return $filtered_limit;
5453           } else {