'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'large', 'include' => '', 'exclude' => '', 'wp_default' => false, 'target_blank' => false, ), $attr)); // This gallery has requested to use the WordPress default gallery if($wp_default) return $contents; $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $include = preg_replace( '/[^0-9,]+/', '', $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) ) { $exclude = preg_replace( '/[^0-9,]+/', '', $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 ''; // This is the custom stuff // Create the gallery content $return = ''; $return .= '
'; $return .= '
'; $return .= ''; $return .= '
'; $return .= '
'; return $return; } add_filter('post_gallery', 'vantage_gallery', 10, 2); /** * Add our fancy slider gallery to the list of gallery types. * * @param $types * @return mixed * * @since vantage 1.0 */ function vantage_gallery_types($types){ $types['slider'] = __('Slider', 'vantage'); return $types; } add_filter('siteorigin_gallery_types', 'vantage_gallery_types'); /** * Set our fancy gallery to the default gallery type. * * @param $types * @return mixed * * @since vantage 1.0 */ function vantage_gallery_default_type(){ return 'slider'; } add_filter('siteorigin_gallery_default_type', 'vantage_gallery_default_type');