Skip to content

Instantly share code, notes, and snippets.

@robneu

robneu/loop.php Secret

Last active March 31, 2016 03:35
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 robneu/a806a41024df2afc9b49 to your computer and use it in GitHub Desktop.
Save robneu/a806a41024df2afc9b49 to your computer and use it in GitHub Desktop.
<?php
/**
* Template action hooks used to display a loop of testimonials.
*
* @package NiceTestimonials\Templates
* @author Robert Neu
* @copyright Copyright (c) 2016, WP Site Care
* @license GPL-2.0+
* @since 1.0.0
*/
do_action( 'nice_testimonials_loop_before', $data );
if ( ! empty( $data['testimonials'] ) ) {
do_action( 'nice_testimonials_loop_start', $data );
foreach ( $data['testimonials'] as $post ) {
setup_postdata( $post );
do_action( 'nice_testimonials_loop_top', $data, $post );
do_action( 'nice_testimonials_loop_content', $data, $post );
do_action( 'nice_testimonials_loop_bottom', $data, $post );
}
do_action( 'nice_testimonials_loop_end', $data );
wp_reset_postdata();
}
do_action( 'nice_testimonials_loop_after', $data );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment