Total hooks: 73Undocumented hooks: 29
Type: action
If we are activating a version, while having another present and activated.
<p>Leave in the Pro version, if it is available.</p>
Arguments: WP_SMUSH_BASENAME, 'Smush', '/plugins/wp-smushit/', 'Get Fast!', '4b14b58816'
Type: filter
Allow to add other settings via filtering the variable
<p>Like Nextgen and S3 integration</p>
Arguments: $this->settings
Filter to skip a single image from lazy load.
Arguments: false, $src
$skip - boolShould skip? Default: false.
$skip
bool
$src - stringImage url.
$src
string
Check if some image formats are excluded.
Arguments: $class
Allows S3 to hook, check and download the file
Arguments: $backup_full_path, $attachment_id, array()
Perform a action after the image URL is updated in post content
Arguments: $image_id, $file_path, $original_file
Filter: wp_smush_image.
<p>Whether to smush the given attachment ID or not.</p>
Arguments: true, $attachment_id
$status - boolSmush all attachments by default.
$status
$attachment_id - intAttachment ID.
$attachment_id
int
Filter: wp_smush_image
<p>Whether to smush the given attachment id or not</p>
$skip - boolWhether to Smush image or not.
$attachment_id - intAttachment ID of the image being processed.
No description
Arguments: $attachment_file_path, $attachment_id
Resize the dimensions of the image.
<p>Filter whether the existing image should be resized or not</p>
$should_resize - boolSet to True by default.
$should_resize
$attachment_id - intImage Attachment ID.
Arguments: $attachment_id, $stats
Arguments: none
Internal filter to disable page parsing.
<p>Because the page parser module is universal, we need to make sure that all modules have the ability to skip parsing of certain pages. For example, lazy loading should skip if_preview() pages. In order to achieve this functionality, I've introduced this filter. Filter priority can be used to overwrite the $skip param.</p>
Arguments: false
$skip - boolSkip status.
Filter to skip a single image from cdn.
Arguments: false, $src, $image
$image - array, boolImage tag or false.
$image
array, bool
Filter hook to alter image tag before replacing the image in content.
Arguments: $new_image
$image - stringImage tag.
Filter hook to alter image src arguments before going through cdn.
Arguments: array(), $image
$args - arrayArguments.
$args
array
$src - stringImage src.
Filter hook to alter image src before going through cdn.
Arguments: $src, $image
Filter hook to alter image src after replacing with CDN base.
Arguments: false, $source['url'], $source
Filter to add/update/bypass additional srcsets.
<p>If empty value or false is retured, additional srcset will not be generated.</p>
Arguments: array(0.2, 0.4, 0.6, 0.8, 1, 2, 3)
$additional_multipliers - array, boolAdditional multipliers.
$additional_multipliers
Arguments: false, $url, false
Arguments: $postid, $_POST
To be stored in DB, Part of code inspired from Ewwww Optimiser
Arguments: $admin_path
Arguments: $skip, $path
Filter whether to convert the PNG to JPG or not
Arguments: $should_convert, $id, $file, $size
$should_convert - boolCurrent choice for image conversion
$should_convert
$id - intAttachment id
$id
$file - stringFile path for the image
$file
$size - stringImage size being converted
$size
Arguments: $id, $file, $n_file, $size
Do action, if the PNG to JPG conversion was successful
Arguments: $id, $meta, $savings
Filter Background Color for Transparent PNGs
Arguments: $transparent_png['background'], $id, $size
Used internally to modify the error message
Arguments: $error, $attachment_id
Allows to format single item in meta.
<p>This filter will be used only for Async, post requests.</p>
Arguments: $value, $key
$value - mixedMeta item value.
$value
mixed
$key - stringMeta item key.
$key
Arguments: 2000
Arguments: 1000
Do not fetch more than this, any time Localizing all rows at once increases the page load and slows down everything
Arguments: 5000
Initialize class variables, after all stuff has been loaded
Arguments: $mime_supported, $mime
Filter whether the uploaded image should be resized or not
Arguments: $should_resize, $id, $meta
$should_resize - bool
$upload - array{ Array of upload data.
$upload
$context - stringThe type of upload action. Values include 'upload' or 'sideload'.
$context
Called after the image has been successfully resized Can be used to update the stored stats
Arguments: $id, $savings
Filter the resize image dimensions
Arguments: array('width' => $this->max_w, 'height' => $this->max_h), $file_path, $id
$sizes - array{ Array of sizes containing max width and height for all the uploaded images.
$sizes
$file_path - stringOriginal Image file path
$file_path
Arguments: 0
Arguments: file_exists($backup), $image_id, $backup
Allows S3 to hook over here and check if the given file path exists else download the file.
Arguments: $attachment_file_path_size, $id, $size_data
Arguments: true, $size_key
Arguments: true, 'full'
Runs if the image smushing was successful
Arguments: $id, $stats, $meta
$id - intImage Id
$stats - arraySmush Stats for the image
$stats
$meta - arrayAttachment meta.
$meta
Arguments: true, $id
$skip - boolBool, whether to Smush image or not.
$ID - intAttachment Id, Attachment id of the image being processed.
$ID
Fix for Hostgator.
<p>Check for use of http url (Hostgator mostly).</p>
$skip - bool, whether to Smush image or not
$Attachment - Id, Attachment id of the image being processed
$Attachment
$id - intAttachment ID of the image being processed.
AJAX Thumbnail Rebuild integration.
Arguments: $id
Arguments: \WP_Smush::get_instance()->core()->mod->smush->is_auto_smush_enabled()
Arguments: true, $size
Arguments: $image->pid, $stats
$ID - intImage Id
Arguments: $mime_supported, $ext
Filter whether the NextGen image should be resized or not
Arguments: $should_resize, $image, $meta
- objectNextGen Gallery image object
object
- arrayNextGen Gallery image object
Arguments: $attachment_id, array('stats' => $savings)
Arguments: $attachment_id, $savings
Arguments: $image_id, $stats
Allows to Enable/Disable WP Retina 2x Integration
Arguments: true
Arguments: true, $image_size
Do not enqueue, unless it is one of the required screen, or not in WordPress backend.
Arguments: $this->tabs
Type: action_reference
Arguments: array(&$this)
Arguments: array('bulk' => 'Bulk Smush', 'directory' => 'Directory Smush', 'integrations' => 'Integrations', 'lazy_load' => 'Lazy Load', 'cdn' => 'CDN', 'tools' => 'Tools', 'settings' => 'Settings')
Allows to hook in additional containers after stats box for free version Pro Version has a full width settings box, so we don't want to do it there.
Arguments: $name