GravityView  2.17
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 GravityView <[email protected]>
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  // @todo Support Ultimate Member 2.0 - for now, prevent fatal error
51  if( ! isset( $ultimatemember->profile ) ) {
52  return;
53  }
54 
55  $active_tab_args = array(
56  'name' => $ultimatemember->profile->active_tab(),
57  'post_type' => 'um_tab',
58  'numberposts' => 1,
59  );
60 
61  $active_tab = get_posts( $active_tab_args );
62 
63  if ( ! $active_tab ) {
64  return;
65  }
66 
67  GravityView_View_Data::getInstance()->parse_post_content( $active_tab[0]->post_content );
68 
69  wp_reset_postdata();
70  }
71 
72 }
73 
static getInstance( $passed_post=NULL)
Definition: class-data.php:122
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...