WC_Regenerate_Images::is_regeneratable()
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() WC Regenerate Images::is regeneratable code WC 9.5.1
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; }