GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-theme-hooks-church-themes.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Add Church Themes compatibility to GravityView
4  *
5  * @file class-gravityview-theme-hooks-church-themes.php
6  * @package GravityView
7  * @license GPL2
8  * @author GravityView <[email protected]>
9  * @link http://gravityview.co
10  * @copyright Copyright 2016, Katz Web Services, Inc.
11  *
12  * @since 1.17
13  */
14 
15 /**
16  * @inheritDoc
17  * @since 1.17
18  */
20 
21  /**
22  * Church Themes framework version number
23  *
24  * @inheritDoc
25  * @since 1.17
26  */
27  protected $constant_name = 'CTFW_VERSION';
28 
29  /**
30  * Add filters
31  *
32  * @since 1.17
33  *
34  * @return void
35  */
36  protected function add_hooks() {
37  parent::add_hooks();
38 
39  add_filter( 'ctfw_has_content', array( $this, 'if_gravityview_return_true' ) );
40  }
41 
42  /**
43  * Tell Church Themes that GravityView has content if the current page is a GV post type or has shortcode
44  *
45  * @since 1.17
46  *
47  * @param bool $has_content Does the post have content?
48  *
49  * @return bool True: It is GV post type, or has shortcode, or $has_content was true.
50  */
51  public function if_gravityview_return_true( $has_content = false ) {
52 
53  if( ! class_exists( 'GravityView_frontend' ) ) {
54  return $has_content;
55  }
56 
58 
59  return ( $instance->is_gravityview_post_type || $instance->post_has_shortcode ) ? true : $has_content;
60  }
61 }
62 
if_gravityview_return_true( $has_content=false)
Tell Church Themes that GravityView has content if the current page is a GV post type or has shortcod...
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...
static getInstance()
Get the one true instantiated self.