The Gallery shortcode.
This implements the functionality of the Gallery Shortcode for displaying WordPress images on a post.
Signature
gallery_shortcode( $attr )
- attr
- (array) Attributes of the shortcode.
Return
(string) HTML content to display gallery.
Source
WP Trac GitHub Bitbucketfunction gallery_shortcode($attr) { $post = get_post(); static $instance = 0; $instance++; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. if ( empty( $attr['orderby'] ) ) $attr['orderby'] = 'post__in'; $attr['include'] = $attr['ids']; } // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) {113 more lines...
Link here
-
URL
http://queryposts.com/function/gallery_shortcode/ -
HTML
<a href='http://queryposts.com/function/gallery_shortcode/'>gallery_shortcode()</a> -
Markdown
[gallery_shortcode()](http://queryposts.com/function/gallery_shortcode/) -
BBCode
[url=http://queryposts.com/function/gallery_shortcode/]gallery_shortcode()[/url]