Alter media caption/description conflict in WordPress?

I wonder if this will work for you: add_action( ‘add_attachment’, function( $attachment_id ){ $a = get_post( $attachment_id ); if ( is_object( $a ) && ‘image’ === substr( $a->post_mime_type, 0, 5 ) ) wp_insert_attachment( array( ‘ID’ => $a->ID, ‘post_excerpt’ => $a->post_content ) ); }); or with less queries: add_action( ‘add_attachment’, function( $attachment_id ){ global $wpdb; if( … Read more

Insert Images at Master Uniform Height

There are multiple solutions: Use CSS for post images: .post img { height: 300px; width: auto; } Use a custom thumbnail size. Either in Settings -> Media or use a third-party plugin to generate them. Another way would be to code your own: function custom_image_sizes() { add_theme_support(‘post-thumbnails’); add_image_size(‘breaking-news’, 9999, 300, true); } function add_custom_sizes( $imageSizes … Read more

How do i upload an image and return the image id?

Take a look at side loading images. media_sideload_image()/wp_handle_sideload() and get the ID from the URL. attachment_url_to_postid. <?php $url = “http://wordpress.org/about/images/logos/wordpress-logo-stacked-rgb.png”; $title = “Some Image Title”; $alt_text = “Some Alt Text”; require_once(ABSPATH . ‘wp-admin/includes/media.php’); require_once(ABSPATH . ‘wp-admin/includes/file.php’); require_once(ABSPATH . ‘wp-admin/includes/image.php’); // sideload the image — requires the files above to work correctly $src = media_sideload_image( $url, … Read more

custom tabs in media uploader

found it. in the automattic SVN for media.php i found the media_upload_header() function, and the only thing left to do is to echo it in the last function: function media_upload_ell_gmap_form() { echo media_upload_header(); ?> <h2>HTML Form</h2> <?php } that’s it.

Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)

I’ve had this same problem for ages and have currently landed on the following combination of plugins to resolve the issue: Media Tags Tag Gallery Cleaner Gallery Additionally, I made two modifications to the tag gallery plugin (to remove TimThumb and allow reverse ordering) This solution still has a lot of downsides including that it … Read more

Filter what image sizes get generated

Picking which image sizes to generate on a per-upload basis is definitely going to be a bit involved. However, if you’re okay with just entirely removing default image sizes, you have a couple of options, as described in this article: The simplest way is to set the default image height and width to ‘0’ at … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)