lifterlms_loop( obj $query = null )
Output a LifterLMS Loop
Parameters Parameters
- $query
-
(obj) (Optional) WP_Query, uses global $wp_query if not supplied
Default value: null
Return Return
(void)
Source Source
File: includes/functions/llms.functions.templates.loop.php
* @version 3.14.0 */ function lifterlms_loop( $query = null ) { global $wp_query; $temp = null; if ( $query ) { $temp = $wp_query; $wp_query = $query; } if ( have_posts() ) { /** * lifterlms_before_loop hook * * @hooked lifterlms_loop_start - 10 */ do_action( 'lifterlms_before_loop' ); while ( have_posts() ) { the_post(); llms_get_template_part( 'loop/content', get_post_type() ); } /** * lifterlms_before_loop hook * * @hooked lifterlms_loop_end - 10 */ do_action( 'lifterlms_after_loop' ); llms_get_template_part( 'loop/pagination' ); } else { llms_get_template( 'loop/none-found.php' ); } if ( $query ) { $wp_query = $temp; wp_reset_postdata(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.14.0 | Introduced. |