'ASC', 'orderby' => 'menu_order ID', 'id' => $post ? $post->ID : 0, 'itemtag' => 'div', 'icontag' => 'div', 'captiontag' => 'div', 'columns' => 3, 'size' => 'medium', 'include' => '', 'exclude' => '', 'link' => '', 'name' => '' ), $attr, 'gallery')); $id = intval($id); if ('RAND' == $order) $orderby = 'none'; if (!empty($include)) { $_attachments = get_posts(array( 'include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby )); $attachments = array(); foreach ($_attachments as $key => $val) { $attachments[$val->ID] = $_attachments[$key]; } } elseif (!empty($exclude)) { $attachments = get_children(array( 'post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby )); } else { $attachments = get_children(array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby )); } if (empty($attachments)) return ''; if (is_feed()) { $output = "\n"; foreach ($attachments as $att_id => $attachment) $output .= wp_get_attachment_link($att_id, $size, true) . "\n"; return $output; } $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $icontag = tag_escape($icontag); $valid_tags = wp_kses_allowed_html('post'); if (!isset($valid_tags[$itemtag])) $itemtag = 'dl'; if (!isset($valid_tags[$captiontag])) $captiontag = 'dd'; if (!isset($valid_tags[$icontag])) $icontag = 'dt'; $columns = intval($columns); $itemwidth = $columns > 0 ? 794 / $columns : 225; $title = ($name ? sanitize_text_field($name) : get_post_format_string('gallery')); $selector = ($name ? beverly_nice_hashtag($name) : "gallery-{$instance}"); $gallery_style = $gallery_div = ''; $size_class = sanitize_html_class($size); $gallery_div = "