Inventory_Presser_Photo_Numberer::save_meta_hash( int $post_id )


Description Description

Saves an MD5 hash checksum of the attachment file bytes in the attachment post meta. This 32 character string can be used for file comparisons while not taxing the server as much as other methods.

Top ↑

Parameters Parameters


(int) (Required)

Top ↑

Return Return


Top ↑

Source Source

File: includes/class-photo-numberer.php

	protected static function save_meta_hash( $post_id ) {
		// Save a md5 hash checksum of the attachment in meta
		$file_path = get_attached_file( $post_id );
		if ( false === $file_path ) {
			apply_filters( 'invp_prefix_meta_key', 'hash' ),
			hash_file( 'md5', $file_path )