GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gv-entry.php
Go to the documentation of this file.
1 <?php
2 namespace GV;
3 
4 /** If this file is called directly, abort. */
5 if ( ! defined( 'GRAVITYVIEW_DIR' ) )
6  die();
7 
8 /**
9  * The base Entry class.
10  *
11  * Contains all entry data and some processing and logic rules.
12  */
13 class Entry {
14 
15  /**
16  * Adds the necessary rewrites for single Entries.
17  *
18  * @internal
19  * @return void
20  */
21  public static function add_rewrite_endpoint() {
22  global $wp_rewrite;
23 
24  $endpoint = self::get_endpoint_name();
25 
26  /** Let's make sure the endpoint array is not polluted. */
27  if ( in_array( array( EP_ALL, $endpoint, $endpoint ), $wp_rewrite->endpoints ) )
28  return;
29 
30  add_rewrite_endpoint( $endpoint, EP_ALL );
31  }
32 
33  /**
34  * Return the endpoint name for a single Entry.
35  *
36  * Also used as the query_var for the time being.
37  *
38  * @internal
39  * @return string The name. Default: "entry"
40  */
41  public static function get_endpoint_name() {
42  /**
43  * @filter `gravityview_directory_endpoint` Change the slug used for single entries
44  * @param[in,out] string $endpoint Slug to use when accessing single entry. Default: `entry`
45  */
46  $endpoint = apply_filters( 'gravityview_directory_endpoint', 'entry' );
47 
48  return sanitize_title( $endpoint );
49  }
50 }
static get_endpoint_name()
Return the endpoint name for a single Entry.
The base Entry class.
static add_rewrite_endpoint()
Adds the necessary rewrites for single Entries.