'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => -1, ); $images_query = new WP_Query($query_args); $images = array(); $actual_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; foreach ($images_query->posts as $img) { $alt = get_post_meta($img->ID, '_wp_attachment_image_alt', true); if(strlen($alt) === 0) { $img_object = array( 'id' => $img->ID, 'name' => $img->post_title, 'url' => wp_get_attachment_thumb_url($img->ID) ); $images[] = $img_object; } } if( isset($_POST['acpAddAlt']) ){ update_post_meta($_POST['thumb_id'], '_wp_attachment_image_alt', $_POST['thumb_alt']); echo ''; } ?>

$value) : ?>
<?php _e('Thumbnail of', 'acp');?> <?php echo $value['name']; ?>

'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => -1, ); $images_query = new WP_Query($query_args); $images = 0; foreach ($images_query->posts as $img) { $alt = get_post_meta($img->ID, '_wp_attachment_image_alt', true); if(strlen($alt) === 0) { $img_object = array( 'id' => $img->ID, 'name' => $img->post_title, 'url' => wp_get_attachment_thumb_url($img->ID) ); $images++; } } global $wp_admin_bar; $args = array( 'id' => 'missing_alts', 'title' => $images . __(' Missing ALT\'s', 'acp'), 'href' => '#', 'group' => false, ); $wp_admin_bar->add_menu( $args ); } add_action( 'wp_before_admin_bar_render', 'acp_missing_alts_notes', 999 );