Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 11

An attachment is an image or other file uploaded through the post editor's upload utility. Attachments can be displayed on their own 'page' or template. For more information, see Using Image and File Attachments.

1
vote
Assuming $attachment_id is the ID of the attachment you want to delete without deleting the file, this should do it: $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->posts, $wpdb->postmeta WHERE $wp …
answered Feb 17 '11 by John P Bloch
1
vote
I've never played with this, but you can attach taxonomies to attachments (either built in or custom) like this: register_taxonomy_for_object_type( 'category', 'attachment' ); Hook that onto 'init … ' to be able to categorize attachments according to category. I don't know how you're 'removing' the image, but if you're deleting it from WordPress, it shouldn't be set as an attachment for that …
answered Aug 18 '10 by John P Bloch
2
votes
Trust us on this one, you want to use WordPress' query solution. It provides a whole bunch of awesome extras, such as object caching, autoloading of metadata, etc. Plus, it's almost guaranteed to be f …
answered Jan 7 '13 by John P Bloch
1
vote
This is difficult/complicated if you want to use WordPress' default category box. For one thing, the metabox doesn't return the output, it just echoes it. On top of that, it wouldn't give you the corr …
answered Aug 18 '10 by John P Bloch
28
votes
There's actually a great function that will do all three of those things for you: media_sideload_image( $url, $post_id, $description ); The first argument is the remote url of the image you want to …
answered Mar 18 '11 by John P Bloch