diff --git a/library/shortcodes.php b/library/shortcodes.php index 3c3ee287..8083f435 100644 --- a/library/shortcodes.php +++ b/library/shortcodes.php @@ -9,28 +9,37 @@ add_shortcode('gallery', 'gallery_shortcode_tbs'); function gallery_shortcode_tbs($attr) { - global $post, $wp_locale; - - $output = ""; - - $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID ); - $attachments = get_posts($args); - if ($attachments) { - $output = '
'; - } - return $output; + $output = ""; + + $ids = explode(",",$array['ids']); + $posts=array(); + + $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' =>'any', 'post_parent' => $post->ID ); + + $attachments = get_posts($args); + if ($attachments) { + $output = '
'; + } + return $output; + + wp_reset_postdata(); } - // Buttons function buttons( $atts, $content = null ) { extract( shortcode_atts( array( @@ -131,4 +140,4 @@ function blockquotes( $atts, $content = null ) { -?> \ No newline at end of file +?>