4 if ( ! defined(
'ABSPATH' ) ) {
107 $this->empty_message = function_exists(
'gv_no_results' ) ?
gv_no_results(
$template_context ) : __(
'No entries match your request.',
'gk-gravityview' );
193 if( empty( $this->entries ) ) {
194 return '<div class="gv-no-results">'.$this->empty_message.
'</div>';
199 if ( $this->template_context instanceof \
GV\Template_Context ) {
200 $current_entry = $this->template_context->entry->as_entry();
205 $output .=
'<'. $this->wrapper_tag .
'>';
207 foreach( $this->entries as
$entry ) {
209 if ( $entry instanceof \
GV\Entry ) {
210 $entry = $entry->as_entry();
213 if( $this->
skip_entry( $entry, $current_entry ) ) {
220 $output .=
'</'. $this->wrapper_tag .
'>';
227 $output = apply_filters(
'gravityview/widget/recent-entries/output',
$output, $this );
243 if( empty( $this->skip_current_entry ) || empty( $current_entry ) ) {
248 $current_entry_id = is_array( $current_entry ) ? $current_entry[
'id'] : $current_entry;
251 if(
$entry[
'id'] === $current_entry_id ) {
282 $link = apply_filters(
'gravityview/entry-list/link',
$link,
$entry, $this );
286 if( !empty( $this->after_link ) ) {
295 $after_link = apply_filters(
'gravityview/entry-list/after-link',
'<div>'.$this->after_link.
'</div>',
$entry, $this );
302 $item_output =
'<'. $this->item_tag .
'>'. $item_output .
'</'. $this->item_tag .
'>';
311 $item_output = apply_filters(
'gravityview/entry-list/item', $item_output,
$entry, $this );
gv_no_results( $wpautop=true, $context=null)
set_after_link( $after_link)
set_context( $context)
Set the context in which this entry list is being displayed.
static getInstance( $passed_post=NULL)
If this file is called directly, abort.
skip_entry( $entry, $current_entry)
Should the current entry be skipped while showing the list of entries?
gravityview_get_link( $href='', $anchor_text='', $atts=array())
Generate an HTML anchor tag with a list of supported attributes.
if( $add_query_args) $link
__construct( $entries=array(), $post_id=0, $form=array(), $link_format='', $after_link='', $context='', $template_context=null, $view_id=0)
set_wrapper_tag( $wrapper_tag)
set_link_format( $link_format)
set_empty_message( $empty_message)
Set the message when there are no entries to display.
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()
get_item_output( $entry)
Get the output for a specific entry.
set_skip_current_entry( $skip_current_entry)
get_output()
Get the HTML output.
static entry_link( $entry, $post_id=NULL, $add_directory_args=true, $view_id=0)
return href for single entry
output()
Echo the output generated by get_output()