, <@ArianKhosravi> */ class BigGallery { protected $_post; protected $_order; protected $_orderby; protected $_id; protected $_attachments; function __construct($post, $attr) { $this->_post = $post; $this->extract_attributes($attr); $this->_attachments = get_children(array('post_parent' => $this->_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $this->_order, 'orderby' => $this->_orderby)); } function extract_attributes($attr) { if (isset($attr['orderby'])) { $attr['orderby'] = sanitize_sql_orderby($attr['orderby']); if (!$attr['orderby']) unset($attr['orderby']); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $this->_post->ID ), $attr)); $id = intval($id); if ('RAND' == $order) $orderby = 'none'; $this->_order = $order; $this->_orderby = $orderby; $this->_id = $id; } function generate_gallery() { $output = PHP_EOL; if (empty($this->_attachments)) return ''; if (is_feed()) { foreach ($this->_attachments as $att_id => $attachment) { $output .= wp_get_attachment_link($att_id, 'thumbnail', true) . PHP_EOL; } return $output; } $thumbs = array(); $first = true; $output .= '
' . PHP_EOL; $output .= '' . PHP_EOL; return $output; } } ?>