-1, // 全件 'post_type' => 'attachment', 'orderby' => 'ID', 'order' => 'DESC', 'post_status' => null, 'post_parent' => null )); $attachments = array(); $ids = ''; foreach( $get_posts as $val ) { if( stripos( $val->post_mime_type, 'image/' ) === 0 ) { $attachments[] = $val->ID; } } unset( $get_posts ); $attachments = array_unique( $attachments ); $post_count = count( $attachments ); if( !empty( $attachments ) ) { $ids = implode( ',', $attachments ); add_action( 'admin_head', function() use( $ids, $post_count ) { $security = 'luxe_regen_thumb'; $ajax_nonce = wp_create_nonce( $security ); ?>