'menu_order ASC, ID ASC', 'ids' => '', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', ), $attr)); $id = intval($id); $orderby = addslashes($orderby); if ( !empty( $ids ) ){ $_ids = explode( ',', $ids ); if ( isset( $_ids ) && is_array( $_ids ) ){ foreach( $_ids as $k => $v ){ $v = intval( trim( $v ) ); } $clean->ids = implode( ',', $_ids ); } $_attachments = $wpdb->get_results(" SELECT * FROM $wpdb->posts WHERE `ID` IN( $clean->ids ) ORDER BY $orderby "); }else{ $_attachments = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&orderby=\"{$orderby}\""); } $attachments = array(); foreach( $_attachments as $order => $a ){ $attachments[ $a->ID ] = $a; } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link($id, $size, true) . "\n"; return $output; } $listtag = tag_escape($listtag); $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $output = apply_filters('gallery_style', " \n"; return $output; } ?>