WordPress filter hook

wpthumb_image_pre

Fired by 4 WordPress plugins, running on 1,110+ sites between them.

How to use wpthumb_image_pre

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wpthumb_image_pre', function( $editor, $args ) {
	// Change $editor here.
	return $editor;
}, 10, 2 );

Argument names come from WPThumb's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

4 plugins that fire wpthumb_image_pre

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WPThumb icon WPThumb800+ installs apply_filters( 'wpthumb_image_pre', $editor, $this->args ) wpthumb.php:408
  2. MapifyLite (by MapifyPro) icon MapifyLite (by MapifyPro)200+ installs apply_filters( 'wpthumb_image_pre', $editor, $this->args ) lib/wpthumb/wpthumb.php:437
  3. Hammy icon Hammy100+ installs apply_filters( 'wpthumb_image_pre', $editor, $this->args ) WPThumb/wpthumb.php:408
  4. WebPlus Gallery on WordPress icon WebPlus Gallery on WordPress10+ installs apply_filters( 'wpthumb_image_pre', $editor, $this->args ) include/WPThumb/wpthumb.php:422

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.