'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'link' => '', 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'numberposts' => -1, 'offset' => '' ); /* Apply filters to the default arguments. */ $defaults = apply_filters( 'cleaner_gallery_defaults', $defaults ); /* Merge the defaults with user input. Make sure $id is an integer. */ $attr = shortcode_atts( $defaults, $attr ); extract( $attr ); $id = intval( $id ); /* Arguments for get_children(). */ $children = array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby, 'exclude' => $exclude, 'include' => $include, 'numberposts' => $numberposts, 'offset' => $offset, ); /* Get image attachments. If none, return. */ $attachments = get_children( $children ); if ( empty( $attachments ) ) return ''; /* Properly escape the gallery tags. */ $itemtag = tag_escape( $itemtag ); $icontag = tag_escape( $icontag ); $captiontag = tag_escape( $captiontag ); $i = 0; /* Count the number of attachments returned. */ $attachment_count = count( $attachments ); /* Allow developers to overwrite the number of columns. This can be useful for reducing columns with with fewer images than number of columns. */ //$columns = ( ( $columns <= $attachment_count ) ? intval( $columns ) : intval( $attachment_count ) ); $columns = apply_filters( 'cleaner_gallery_columns', intval( $columns ), $attachment_count, $attr ); /* Open the gallery
. */ $output = "\n\t\t\t"; /* Close the gallery
. */ $output .= "\n\t\t\t
\n"; /* Return out very nice, valid HTML gallery. */ return $output; } ?>