Skip to content

Instantly share code, notes, and snippets.

@hasdavidc
Created March 14, 2014 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hasdavidc/9543582 to your computer and use it in GitHub Desktop.
Save hasdavidc/9543582 to your computer and use it in GitHub Desktop.
pertinent get_slides
<?php
/**
* The main query for extracting the slides for the slideshow
*/
public function get_slides() {
$args = array(
'force_no_custom_order' => true,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_type' => 'attachment',
'post_status' => 'inherit',
'lang' => '', // polylang, ingore language filter
'suppress_filters' => 1, // wpml, ignore language filter
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'ml-slider',
'field' => 'slug',
'terms' => $this->id
)
)
);
$args = apply_filters('metaslider_populate_slides_args', $args, $this->id, $this->settings);
$query = new WP_Query($args);
return $query;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment