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/views';
34 protected $theme_template_directory =
'gravityview/views/';
40 protected $plugin_template_directory =
'templates/views/';
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' ) );
104 $specifics = array();
106 list( $slug_dir, $slug_name ) = self::split_slug( $slug,
$name );
110 if ( ! $this->request->is_view(
false ) &&
$post ) {
111 $specifics []= sprintf(
'%spost-%d-view-%d-%s.php', $slug_dir, $post->ID, $this->view->ID, $slug_name );
112 $specifics []= sprintf(
'%spost-%d-%s.php', $slug_dir, $post->ID, $slug_name );
116 $specifics []= sprintf(
'%sview-%d-%s.php', $slug_dir, $this->view->ID, $slug_name );
117 $specifics []= sprintf(
'%sform-%d-%s.php', $slug_dir, $this->view->form->ID, $slug_name );
128 $context = Template_Context::from_template( $this );
139 $this->push_template_data( $context = apply_filters(
'gravityview/template/view/context', $context, $this ),
'gravityview' );
146 do_action(
'gravityview/template/view/render', $context );
149 $this->get_template_part( static::$slug );
150 $this->pop_template_data(
'gravityview' );
155 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-view-table.php' );
156 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-view-list.php' );
157 require
gravityview()->plugin->dir(
'future/includes/class-gv-template-view-legacy.php' );
If this file is called directly, abort.
add_id_specific_templates( $templates, $slug, $name)
Enable granular template overrides based on current post, view, form, etc.
If this file is called directly, abort.
If this file is called directly, abort.
render()
Output some HTML.
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.
If this file is called directly, abort.
__construct(View $view, Entry_Collection $entries, Request $request)
Initializer.