687 | | if ( $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)) ) { |
688 | | /** @todo Get post_ids and delete cache */ |
689 | | // wp_cache_delete($post_id, 'post_meta'); |
| 687 | $post_ids = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)); |
| 688 | if ( $post_ids ) { |
| 689 | $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $post_meta_key)); |
| 690 | foreach ( $post_ids as $post_id ) |
| 691 | wp_cache_delete($post_id, 'post_meta'); |