Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: editor_max_image_size

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
124       *     @type int $0 The maximum width in pixels.
125       *     @type int $1 The maximum height in pixels.
126       * }
127       * @param string|int[] $size     Requested image size. Can be any registered image size name, or
128       *                               an array of width and height values in pixels (in that order).
129       * @param string       $context  The context the image is being resized for.
130       *                               Possible values are 'display' (like in a theme)
131       *                               or 'edit' (like inserting into an editor).
132       */
133      list( $max_width, $max_height ) = apply_filters( 'editor_max_image_size', array( $max_width, $max_height ), $size, $context );
134
135      return wp_constrain_dimensions( $width, $height, $max_width, $max_height );
136 }
137
138 /**
139  * Retrieve width and height attributes using given width and height values.
140  *
141  * Both attributes are required in the sense that both parameters must have a
142  * value, but are optional in that if you set them to false or null, then they