Skip to main content

gravityview_get_entry()

function gravityview_get_entry( $entry_slug, $force_allow_ids=false, $check_entry_display=true, $view=null )

Return a single entry object

Since 1.4, supports custom entry slugs. The way that GravityView fetches an entry based on the custom slug is by searching gravityview_unique_id meta. The $entry_slug is fetched by getting the current query var set by is_single_entry()

Since:

  • 1.4 (Supports custom entry slugs)
  • 2.6 (Added $view parameter)

Source: includes/connector-functions.php:121

Parameters

NameTypeDefaultDescription
$entry_slugint | stringEntry ID or slug
$force_allow_idsbooleanfalseForce the get_entry() method to allow passed entry IDs, even if the gravityview_custom_entry_slug_allow_id filter returns false.
$check_entry_displaybooleantrueCheck whether the entry is visible for the current View configuration. Default: true {@since 1.14}
$view\GV\ViewnullThe View if $check_entry_display is set to true. {@since develop}

Returns

  • array | boolean