Change default selection for “Embed or Link”?
Change default selection for “Embed or Link”?
Change default selection for “Embed or Link”?
Rename attachment filenames to attachment ID on upload
What is the best way to store thumbnails for a non-image attachment?
Custom image sizes add to metadata
The problem is that even if there was such a function (I am not aware of one) all older links to those files would need to be updated as well. As links, src of images,… in the content of posts aren’t linked to the attachments in the DB but just HTML in the posts content … Read more
How to limit number of attachments
I think the problem is that you’re passing the wrong arguments to the $attachments query, causing you not to get the intended posts in the $attachments query. Here’s what you’re doing: $args = array( ‘post_status’ => ‘inherit’, ‘numberposts’ => 0, ‘post__not_in’ => array_merge($do_not_duplicate,get_option( ‘sticky_posts’ )), ‘post_type’ => ‘attachment’, ); $args[‘tax_query’] = array( array( ‘taxonomy’ => … Read more
Clean up images, delete unused image sizes attached to a post type
Attachments should always use the absolute filesystem path. Also to change the Content-Type of the email you should use the wp_mail_content_type filter. <?php function my_custom_email() { $to = ‘[email protected]’; $subject=”WordPress wp_mail”; $message=” <html> <body> <table rules=”all” style=”border-color: #666;” cellpadding=”10″> <tr>Hello WordPress</tr> </table> </body> </html> “; $attachments = array( WP_PLUGIN_DIR . ‘/my-plugin/uploads/sample_photo_01.jpg’ ); $headers[] = ‘From: … Read more
Replacing the content of an image attachment using API