PluginProbe
WP Ultimate Post Grid / 1.5
WP Ultimate Post Grid v1.5
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / helpers / content.php

content.php in WP Ultimate Post Grid 1.5, at helpers/content.php

31 lines 803 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class WPUPG_Content {
4
5 public function __construct()
6 {
7 add_filter( 'the_content', array( $this, 'content_filter' ), 10 );
8 }
9
10 public function content_filter( $content )
11 {
12 $ignore_query = !is_main_query();
13 if ( apply_filters( 'wpupg_content_loop_check', $ignore_query ) ) {
14 return $content;
15 }
16
17 if ( get_post_type() == WPUPG_POST_TYPE ) {
18 remove_filter( 'the_content', array( $this, 'content_filter' ), 10 );
19
20 $grid = new WPUPG_Grid( get_post() );
21
22 $content .= '<div class="wpupg-grid">';
23 $content .= $grid->draw_posts();
24 $content .= '</div>';
25
26 add_filter( 'the_content', array( $this, 'content_filter' ), 10 );
27 }
28
29 return $content;
30 }
31 }