GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-plugin-hooks-ultimate-member.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Add Ultimate Member plugin compatibility to GravityView
4  *
5  * @file class-gravityview-theme-hooks-ultimate-member.php
6  * @package GravityView
7  * @license GPL2+
8  * @author Katz Web Services, Inc.
9  * @link http://gravityview.co
10  * @copyright Copyright 2016', Katz Web Services, Inc.
11  *
12  * @since 1.17.2
13  */
14 
15 /**
16  * @inheritDoc
17  * @since 1.17.2
18  */
20 
21  /**
22  * @inheritDoc
23  * @since 1.17.2
24  */
25  protected $constant_name = 'ultimatemember_version';
26 
27  function add_hooks() {
28  parent::add_hooks();
29 
30  // Needs to be early to be triggered before DataTables
31  add_action( 'template_redirect', array( $this, 'parse_um_profile_post_content' ) );
32  }
33 
34  /**
35  * Parse tab content in Ultimate Member profile tabs
36  *
37  * @since 1.17.2
38  *
39  * @param array $args Ultimate Member profile settings array
40  *
41  * @return void
42  */
43  function parse_um_profile_post_content( $args = array() ) {
44  global $ultimatemember;
45 
46  if( ! $ultimatemember || ! is_object( $ultimatemember ) || ! class_exists( 'GravityView_View_Data' ) ) {
47  return;
48  }
49 
50  $active_tab_args = array(
51  'name' => $ultimatemember->profile->active_tab(),
52  'post_type' => 'um_tab',
53  'numberposts' => 1,
54  );
55 
56  $active_tab = get_posts( $active_tab_args );
57 
58  if ( ! $active_tab ) {
59  return;
60  }
61 
62  GravityView_View_Data::getInstance()->parse_post_content( $active_tab[0]->post_content );
63 
64  wp_reset_postdata();
65  }
66 
67 }
68 
static getInstance($passed_post=NULL)
Definition: class-data.php:119
parse_um_profile_post_content($args=array())
Parse tab content in Ultimate Member profile tabs.
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...