WC_Regenerate_Images::is_regeneratable()public staticWC 1.0

Ensure we are dealing with the correct image attachment

Method of the class: WC_Regenerate_Images{}

No Hooks.

Return

true|false.

Usage

$result = WC_Regenerate_Images::is_regeneratable( $attachment );
$attachment(int|WP_Post) (required)
Attachment object or ID.

WC_Regenerate_Images::is_regeneratable() code WC 8.7.0

public static function is_regeneratable( $attachment ) {
	if ( 'site-icon' === get_post_meta( is_object( $attachment ) ? $attachment->ID : $attachment, '_wp_attachment_context', true ) ) {
		return false;
	}

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

	return false;
}