posts." where "; $delete_images=$_POST['SEO_Jerusalem_delete_image']; foreach($delete_images as $delete_image_id => $value ){ $query.='`ID`='.$delete_image_id.' OR '; } $query.="`ID`=-1"; if ($wpdb->query($query)){ echo "Files Deleted!"; } } echo "

Clean Up links

"; echo "listing all images that are less than 400x400
"; $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null, // any parent ); $attachments = get_posts($args); $i=0; echo '
'; if ($attachments) { foreach ($attachments as $attachment) { setup_postdata($post); $data=wp_get_attachment_image_src( $attachment->ID, 'full'); $width=$data[1]; $height=$data[2]; if ($width<400 ||$height<400){ echo ""; echo $i++.') '.$attachment->ID." is too small ($width x $height)"; the_attachment_link($attachment->ID, true); edit_post_link( "Edit post", "" , "", $attachment->post_parent ); echo "
"; } /*the_title(); the_attachment_link($post->ID, false); the_excerpt();*/ } } echo "

"; echo ""; echo "

"; echo "
"; } ?>