5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
14 if ( ! class_exists(
'\GV\Gamajo_Template_Loader' ) ) {
15 require
gravityview()->plugin->dir(
'future/lib/class-gamajo-template-loader.php' );
28 protected $filter_prefix =
'gravityview/template/entries';
34 protected $theme_template_directory =
'gravityview/entries/';
40 protected $plugin_template_directory =
'templates/entries/';
72 $this->request = $request;
75 add_filter( $this->filter_prefix .
'_get_template_part', array( $this,
'add_id_specific_templates' ), 10, 3 );
77 parent::__construct();
81 remove_filter( $this->filter_prefix .
'_get_template_part', array( $this,
'add_id_specific_templates' ) );
109 $specifics = array();
111 list( $slug_dir, $slug_name ) = self::split_slug( $slug,
$name );
115 if ( ! $this->request->is_view(
false ) &&
$post ) {
116 $specifics []= sprintf(
'%spost-%d-view-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $this->entry->ID, $slug_name );
117 $specifics []= sprintf(
'%spost-%d-entry-%d-%s.php', $slug_dir, $post->ID, $this->entry->ID, $slug_name );
118 $specifics []= sprintf(
'%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
119 $specifics []= sprintf(
'%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
122 $specifics []= sprintf(
'%sview-%d-entry-%d-%s.php', $slug_dir, $this->view->ID, $this->entry->ID, $slug_name );
123 $specifics []= sprintf(
'%sform-%d-entry-%d-%s.php', $slug_dir, $this->view->form->ID, $this->entry->ID, $slug_name );
124 $specifics []= sprintf(
'%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
125 $specifics []= sprintf(
'%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
127 $specifics []= sprintf(
'%sentry-%d-%s.php', $slug_dir, $this->entry->ID, $slug_name );
138 $context = Template_Context::from_template( $this );
149 $this->push_template_data( apply_filters(
'gravityview/template/entry/context', $context, $this ),
'gravityview' );
152 $this->get_template_part( static::$slug );
153 $this->pop_template_data(
'gravityview' );
166 if ( ! $this->view ) {
170 $back_link_label = $this->view->settings->get(
'back_link_label', null );
174 return do_shortcode( $back_link_label );
176 return $back_link_label;
181 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-entry-table.php' );
182 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-entry-list.php' );
183 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-entry-legacy.php' );
If this file is called directly, abort.
If this file is called directly, abort.
render()
Output some HTML.
add_id_specific_templates( $templates, $slug, $name)
Enable granular template overrides based on current post, view, form, etc.
__construct(Entry $entry, View $view, Request $request)
Initializer.
static replace_variables( $text, $form=array(), $entry=array(), $url_encode=false, $esc_html=true, $nl2br=true, $format='html', $aux_data=array())
Alias for GravityView_Merge_Tags::replace_variables()
If this file is called directly, abort.
If this file is called directly, abort.
get_back_label( $do_replace=true)
Fetch the back link label for an entry context.
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.