WC_Regenerate_Images::is_regeneratable( int|WP_Post $attachment )

Ensure we are dealing with the correct image attachment


Description Description


Parameters Parameters

$attachment

(Required) Attachment object or ID.


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

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