5 if ( ! defined(
'GRAVITYVIEW_DIR' ) ) {
29 if ( is_null( $request ) ) {
33 if ( ! $request->is_renderable() ) {
34 gravityview()->log->error(
'Renderer unable to render Entry in {request_class} context', array(
'request_class' => get_class( $request ) ) );
41 if ( post_password_required( $view->ID ) ) {
42 return get_the_password_form( $view->ID );
55 do_action(
'gravityview_render_entry_' . $view->ID, $entry, $view, $request );
60 foreach ( $view->joins as $join ) {
61 $form_ids[] = $join->join->ID;
62 $form_ids[] = $join->join_on->ID;
64 foreach ( $entry->entries as $e ) {
65 if ( ! in_array( $e[
'form_id'], $form_ids ) ) {
66 gravityview()->log->error(
'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array(
'entry_id' => $e->ID,
'view_id' => $view->ID ) );
70 }
else if ( $view->form && $view->form->ID != $entry[
'form_id'] ) {
71 gravityview()->log->error(
'The requested entry does not belong to this View. Entry #{entry_id}, #View {view_id}', array(
'entry_id' => $entry->ID,
'view_id' => $view->ID ) );
83 $template_slug = apply_filters(
'gravityview_template_slug_' . $view->settings->get(
'template' ),
'table',
'single' );
88 $override = new \GV\Legacy_Override_Template( $view, $entry, null, $request );
89 foreach ( array(
'single' ) as $part ) {
90 if ( ( $path = $override->get_template_part( $template_slug, $part ) ) && strpos( $path,
'/deprecated' ) === false ) {
94 gravityview()->log->notice(
'Legacy templates detected in theme {path}', array(
'path' => $path ) );
99 add_action(
'gravityview_before', $this->legacy_template_warning( $view, $path ) );
101 return $override->render( $template_slug );
113 $class = apply_filters(
'gravityview/template/entry/class', sprintf(
'\GV\Entry_%s_Template', ucfirst( $template_slug ) ), $entry, $view, $request );
115 gravityview()->log->notice(
'{template_class} not found, falling back to legacy', array(
'template_class' =>
$class ) );
116 $class =
'\GV\Entry_Legacy_Template';
120 add_action(
'gravityview/template/after', $view_id_output =
function( $context ) {
121 printf(
'<input type="hidden" class="gravityview-view-id" value="%d">', $context->view->ID );
126 $entries->add( $entry );
129 'entries' => $entries,
131 'request' => $request,
137 remove_action(
'gravityview/template/after', $view_id_output );
139 return ob_get_clean();
If this file is called directly, abort.
if(! isset( $gravityview)||empty( $gravityview->template)) $template
The entry loop for the list output.
If this file is called directly, abort.
static push( $configuration)
Set the state depending on the provided configuration.
If this file is called directly, abort.
If this file is called directly, abort.
gravityview()
The main GravityView wrapper function.
If this file is called directly, abort.
If this file is called directly, abort.
render(Entry $entry, View $view, Request $request=null)
Renders a single instance.