Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thanks webord,

    Very helpful right now. BTW: you may want to escape the url. For my purposes, I needed to.

    $id = $wpdb->get_var($wpdb->prepare("SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $url));

Viewing 1 replies (of 1 total)