Fix image handling for md5

This commit is contained in:
JayWood 2019-10-13 14:49:12 -04:00
parent 3dbd19ac5f
commit e872a0feed

View file

@ -184,8 +184,9 @@ class Generate {
}
$file_md5 = md5_file( $tmp );
$id = $wpdb->get_col( $wpdb->prepare( "select post_id from {$wpdb->postmeta} where meta_key = %s and meta_value = %s", self::IMAGE_MD5_KEY, $file_md5 ) );
$id = $wpdb->get_var( $wpdb->prepare( "select post_id from {$wpdb->postmeta} where meta_key = %s and meta_value = %s", self::IMAGE_MD5_KEY, $file_md5 ) );
if ( $id ) {
WP_CLI::line( 'Found an id for the image - ' . $id );
return absint( $id );
}