WC_Regenerate_Images_Request::is_regeneratable( WP_Post $attachment )

Determines whether an attachment can have its thumbnails regenerated.


Description Description

Adapted from Regenerate Thumbnails by Alex Mills.


Parameters Parameters

$attachment

(Required) An attachment's post object.


Top ↑

Return Return

(bool) Whether the given attachment can have its thumbnails regenerated.


Top ↑

Source Source

File: includes/class-wc-regenerate-images-request.php

	protected function is_regeneratable( $attachment ) {
		if ( 'site-icon' === get_post_meta( $attachment->ID, '_wp_attachment_context', true ) ) {
			return false;
		}

		if ( wp_attachment_is_image( $attachment ) ) {
			return true;
		}

		return false;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.