[vc_row full_width="stretch_row_content_no_spaces" wpex_bg_color="palette-88"][vc_column][vcex_grid_container][vcex_image image_id="976" fill_column="true" el_class="wpex-row-span-2" aspect_ratio="3/4"][vcex_image image_id="973"][vcex_image image_id="981"][vcex_image image_id="982"][vcex_image image_id="978"][/vcex_grid_container][/vc_column][/vc_row]
Update some meta for all media library items
Only run this once! uncomment the „add_action“ then open site and then comment it out again. Watch your timeout depending on how many images you have.
/*
* Update ALL attachments metada with Width and Height
*
* Important: Run Only Once
*
*/
//add_action('admin_init','wpse_35680_run_only_once');
function wpse_35680_run_only_once()
{
global $wpdb;
$attachments = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_mime_type LIKE '%image%'" );
foreach( $attachments as $att )
{
list( $url, $width, $height ) = wp_get_attachment_image_src( $att->ID, 'full' );
update_post_meta( $att->ID, '_width', $width );
update_post_meta( $att->ID, '_height', $height );
}
}
