mirror of
https://ghproxy.net/https://github.com/JayWood/jw-wpcli-random-posts.git
synced 2025-08-18 19:06:03 +08:00
Fix image handling for md5
This commit is contained in:
parent
3dbd19ac5f
commit
e872a0feed
1 changed files with 2 additions and 1 deletions
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue