GravityView  2.10.1
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-theme-hooks-siteorigin.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Add SiteOrigin plugin theme compatibility to GravityView
4  *
5  * @file class-gravityview-theme-hooks-siteorigin.php
6  * @package GravityView
7  * @license GPL2+
8  * @author GravityView <[email protected]>
9  * @link http://gravityview.co
10  * @copyright Copyright 2015, Katz Web Services, Inc.
11  *
12  * @since 2.0.7
13  */
14 
15 /**
16  * @inheritDoc
17  * @since 2.0.7
18  */
20 
21  protected $constant_name = 'SITEORIGIN_PANELS_VERSION';
22 
23  protected $class_name = 'SiteOrigin_Panels';
24 
25  protected $content_meta_keys = array(
26  'panels_data'
27  );
28 
29  /**
30  * Add support for SiteOrigin storage of widget information
31  *
32  * @since 2.0.7
33  *
34  * @param array $meta_keys
35  * @param null $post
36  * @param \GV\View_Collection $views
37  *
38  * @return array
39  */
40  function merge_content_meta_keys( $meta_keys = array(), $post = null, & $views = null ) {
41 
42  if( empty( $post->panels_data ) || empty( $post->panels_data['widgets'] ) ) {
43  return $meta_keys;
44  }
45 
46  foreach ( (array) $post->panels_data['widgets'] as $widget ) {
47 
48  $views->merge( \GV\View_Collection::from_content( \GV\Utils::get( $widget, 'text' ) ) );
49 
50  if ( empty( $widget['tabs'] ) || ! is_array( $widget['tabs'] ) ) {
51  continue;
52  }
53 
54  foreach ( $widget['tabs'] as $tab ) {
55 
56  // Livemesh Tabs
57  $backup = \GV\Utils::get( $tab, 'tab_content' );
58 
59  // SiteOrigin Tabs
60  $content = \GV\Utils::get( $tab, 'content_text', $backup );
61 
62  if( $content ) {
63  $views->merge( \GV\View_Collection::from_content( $content ) );
64  }
65  }
66  }
67 
68  return $meta_keys;
69  }
70 
71 }
72 
global $post
Definition: delete-entry.php:7
merge_content_meta_keys( $meta_keys=array(), $post=null, & $views=null)
Add support for SiteOrigin storage of widget information.
get( $key, $default=null)
Retrieve a setting.
if(empty( $field_settings['content'])) $content
Definition: custom.php:37
$meta_keys
Define the keys to be parsed by the gravityview/data/parse/meta_keys hook.
static get( $array, $key, $default=null)
Grab a value from an array or an object or default.
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...