本文整理汇总了PHP中GravityView_View::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP GravityView_View::getInstance方法的具体用法?PHP GravityView_View::getInstance怎么用?PHP GravityView_View::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GravityView_View
的用法示例。
在下文中一共展示了GravityView_View::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_frontend
public function render_frontend($widget_args, $content = '', $context = '')
{
$gravityview_view = GravityView_View::getInstance();
if (!$this->pre_render_frontend()) {
return;
}
if (!empty($widget_args['title'])) {
echo $widget_args['title'];
}
$pagination_counts = $gravityview_view->getPaginationCounts();
$total = $first = $last = null;
$output = '';
if (!empty($pagination_counts)) {
$first = $pagination_counts['first'];
$last = $pagination_counts['last'];
$total = $pagination_counts['total'];
$class = !empty($widget_args['custom_class']) ? $widget_args['custom_class'] : '';
$class = gravityview_sanitize_html_class($class);
$output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf(__('Displaying %1$s - %2$s of %3$s', 'gravityview'), number_format_i18n($first), number_format_i18n($last), number_format_i18n($total)) . '</p></div>';
}
/**
* @filter `gravityview_pagination_output` Modify the pagination widget output
* @param string $output HTML output
* @param int $first First entry #
* @param int $last Last entry #
* @param int $total Total entries #
*/
echo apply_filters('gravityview_pagination_output', $output, $first, $last, $total);
}
示例2: get_view_detail
/**
* Display details for the current View
*
* @since 1.13
*
* @param string $detail The information requested about the current View. Accepts `total_entries`, `first_entry` (entry #), `last_entry` (entry #), and `page_size`
*
* @return string Detail information
*/
private function get_view_detail($detail = '')
{
$gravityview_view = GravityView_View::getInstance();
$return = '';
switch ($detail) {
case 'total_entries':
$return = number_format_i18n($gravityview_view->getTotalEntries());
break;
case 'first_entry':
$paging = $gravityview_view->getPaginationCounts();
$return = empty($paging) ? '' : number_format_i18n($paging['first']);
break;
case 'last_entry':
$paging = $gravityview_view->getPaginationCounts();
$return = empty($paging) ? '' : number_format_i18n($paging['last']);
break;
case 'page_size':
$paging = $gravityview_view->getPaging();
$return = number_format_i18n($paging['page_size']);
break;
}
/**
* @filter `gravityview/shortcode/detail/{$detail}` Filter the detail output returned from `[gravityview detail="$detail"]`
* @since 1.13
* @param string $return Existing output
*/
$return = apply_filters('gravityview/shortcode/detail/' . $detail, $return);
return $return;
}
示例3: render_frontend
public function render_frontend($widget_args, $content = '', $context = '')
{
$gravityview_view = GravityView_View::getInstance();
if (!$this->pre_render_frontend()) {
return;
}
$page_size = $gravityview_view->paging['page_size'];
$total = $gravityview_view->total_entries;
$atts = shortcode_atts(array('show_all' => !empty($this->settings['show_all']['default'])), $widget_args, 'gravityview_widget_page_links');
// displaying info
$curr_page = empty($_GET['pagenum']) ? 1 : intval($_GET['pagenum']);
$page_link_args = array('base' => add_query_arg('pagenum', '%#%', gv_directory_link()), 'format' => '&pagenum=%#%', 'add_args' => array(), 'prev_text' => '«', 'next_text' => '»', 'type' => 'list', 'end_size' => 1, 'mid_size' => 2, 'total' => empty($page_size) ? 0 : ceil($total / $page_size), 'current' => $curr_page, 'show_all' => !empty($atts['show_all']));
/**
* @filter `gravityview_page_links_args` Filter the pagination options
* @since 1.1.4
* @param array $page_link_args Array of arguments for the `paginate_links()` function. [Read more about `paginate_links()`](http://developer.wordpress.org/reference/functions/paginate_links/)
*/
$page_link_args = apply_filters('gravityview_page_links_args', $page_link_args);
$page_links = paginate_links($page_link_args);
if (!empty($page_links)) {
$class = !empty($widget_args['custom_class']) ? $widget_args['custom_class'] : '';
$class = gravityview_sanitize_html_class($class);
echo '<div class="gv-widget-page-links ' . $class . '">' . $page_links . '</div>';
} else {
do_action('gravityview_log_debug', 'GravityView_Widget_Page_Links[render_frontend] No page links; paginate_links() returned empty response.');
}
}
示例4: widget
public function widget($args, $instance)
{
// Don't show unless a View ID has been set.
if (empty($instance['view_id'])) {
do_action('gravityview_log_debug', sprintf('%s[widget]: No View ID has been defined. Not showing the widget.', get_class($this)), $instance);
return;
}
/** This filter is documented in wp-includes/default-widgets.php */
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
echo $args['before_widget'];
if ($title) {
echo $args['before_title'] . $title . $args['after_title'];
}
// @todo Add to the widget configuration form
$instance['search_layout'] = apply_filters('gravityview/widget/search/layout', 'vertical', $instance);
$instance['context'] = 'wp_widget';
// form
$instance['form_id'] = GVCommon::get_meta_form_id($instance['view_id']);
$instance['form'] = GVCommon::get_form($instance['form_id']);
// We don't want to overwrite existing context, etc.
$previous_view = GravityView_View::getInstance();
/** @hack */
new GravityView_View($instance);
GravityView_Widget_Search::getInstance()->render_frontend($instance);
/**
* Restore previous View context
* @hack
*/
new GravityView_View($previous_view);
echo $args['after_widget'];
}
示例5: render_frontend
public function render_frontend($widget_args, $content = '', $context = '')
{
$gravityview_view = GravityView_View::getInstance();
if (!$this->pre_render_frontend()) {
return;
}
if (!empty($widget_args['title'])) {
echo $widget_args['title'];
}
$offset = $gravityview_view->paging['offset'];
$page_size = $gravityview_view->paging['page_size'];
$total = $gravityview_view->total_entries;
if (empty($total)) {
do_action('gravityview_log_debug', sprintf('%s[render_frontend]: No entries.', get_class($this)));
return;
}
// displaying info
if ($total == 0) {
$first = $last = 0;
} else {
$first = empty($offset) ? 1 : $offset + 1;
$last = $offset + $page_size > $total ? $total : $offset + $page_size;
}
/**
* Modify the displayed pagination numbers
* @param array $counts Array with $first, $last, $total
* @var array array with $first, $last, $total numbers in that order.
*/
list($first, $last, $total) = apply_filters('gravityview_pagination_counts', array($first, $last, $total));
$class = !empty($widget_args['custom_class']) ? $widget_args['custom_class'] : '';
$class = gravityview_sanitize_html_class($class);
$output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf(__('Displaying %1$s - %2$s of %3$s', 'gravityview'), $first, $last, $total) . '</p></div>';
echo apply_filters('gravityview_pagination_output', $output, $first, $last, $total);
}
示例6: test_get_edit_link
/**
* @covers GravityView_Edit_Entry::get_edit_link()
*/
function test_get_edit_link()
{
$form = $this->factory->form->create_and_get();
$editor = $this->factory->user->create_and_set(array('user_login' => 'editor', 'role' => 'editor'));
$entry = $this->factory->entry->create_and_get(array('form_id' => $form['id'], 'created_by' => $editor->ID));
$view = $this->factory->view->create_and_get(array('form_id' => $form['id'], 'settings' => array('user_edit' => 1)));
$this->assertNotEmpty($view, 'There was an error creating the View');
$post_title = new WP_UnitTest_Generator_Sequence(__METHOD__ . ' %s');
$post_id = $this->factory->post->create(array('post_title' => $post_title->next(), 'post_content' => sprintf('[gravityview id="%d"]', $view->ID)));
$nonce_key = GravityView_Edit_Entry::get_nonce_key($view->ID, $entry['form_id'], $entry['id']);
$nonce = wp_create_nonce($nonce_key);
###
### NO POST
###
$edit_link_no_post = GravityView_Edit_Entry::get_edit_link($entry, $view->ID);
// A link to the raw
$this->assertEquals('?page=gf_entries&view=entry&edit=' . $nonce, $edit_link_no_post);
$args = array('p' => $post_id, 'entry' => $entry['id'], 'gvid' => $view->ID, 'page' => 'gf_entries', 'view' => 'entry', 'edit' => $nonce);
// When running all tests, this test thinks we have multiple Views. Correct that.
GravityView_View::getInstance()->setViewId($view->ID);
###
### WITH POST
###
$edit_link_with_post = GravityView_Edit_Entry::get_edit_link($entry, $view->ID, $post_id);
$this->assertEquals(add_query_arg($args, 'http://example.org/'), $edit_link_with_post);
}
示例7: shortcode
/**
* @param array $atts {
* @type string $view_id Define the ID for the View where the entry will
* @type string $entry_id ID of the entry to edit. If undefined, uses the current entry ID
* @type string $post_id ID of the base post or page to use for an embedded View
* @type string $link_atts Whether to open Edit Entry link in a new window or the same window
* @type string $return What should the shortcode return: link HTML (`html`) or the URL (`url`). Default: `html`
* @type string $field_values Parameters to pass in to the Edit Entry form to prefill data. Uses the same format as Gravity Forms "Allow field to be populated dynamically" {@see https://www.gravityhelp.com/documentation/article/allow-field-to-be-populated-dynamically/ }
* }
* @param string $content
* @param string $context
*
* @return string|void
*/
public function shortcode($atts = array(), $content = '', $context = 'gv_edit_entry')
{
// Make sure GV is loaded
if (!class_exists('GravityView_frontend') || !class_exists('GravityView_View')) {
return null;
}
$defaults = array('view_id' => 0, 'entry_id' => 0, 'post_id' => 0, 'link_atts' => '', 'return' => 'html', 'field_values' => '');
$settings = shortcode_atts($defaults, $atts, $context);
if (empty($settings['view_id'])) {
$view_id = GravityView_View::getInstance()->getViewId();
} else {
$view_id = absint($settings['view_id']);
}
if (empty($view_id)) {
do_action('gravityview_log_debug', __METHOD__ . ' A View ID was not defined');
return null;
}
$post_id = empty($settings['post_id']) ? $view_id : absint($settings['post_id']);
$form_id = gravityview_get_form_id($view_id);
$backup_entry_id = GravityView_frontend::getInstance()->getSingleEntry() ? GravityView_frontend::getInstance()->getSingleEntry() : GravityView_View::getInstance()->getCurrentEntry();
$entry_id = empty($settings['entry_id']) ? $backup_entry_id : absint($settings['entry_id']);
if (empty($entry_id)) {
do_action('gravityview_log_debug', __METHOD__ . ' No entry defined');
return null;
}
// By default, show only current user
$user = wp_get_current_user();
if (!$user) {
do_action('gravityview_log_debug', __METHOD__ . ' No user defined; edit entry requires logged in user');
return null;
}
$entry = $this->get_entry($entry_id, $form_id);
// No search results
if (false === $entry) {
do_action('gravityview_log_debug', __METHOD__ . ' No entries match the entry ID defined', $entry_id);
return null;
}
// Check permissions
if (false === GravityView_Edit_Entry::check_user_cap_edit_entry($entry, $view_id)) {
do_action('gravityview_log_debug', __METHOD__ . ' User does not have the capability to edit this entry: ' . $entry_id);
return null;
}
$href = GravityView_Delete_Entry::get_delete_link($entry, $view_id, $post_id, $settings);
// Get just the URL, not the tag
if ('url' === $settings['return']) {
return $href;
}
$link_text = empty($content) ? __('Delete Entry', 'gravityview') : $content;
return gravityview_get_link($href, $link_text, $settings['link_atts']);
}
示例8: test_shortcode_get_view_detail_TOTAL_ENTRIES
/**
* @covers GravityView_Shortcode::get_view_detail
* @covers GravityView_View::setTotalEntries
*/
function test_shortcode_get_view_detail_TOTAL_ENTRIES()
{
GravityView_View::getInstance()->setTotalEntries(0);
$value = do_shortcode('[gravityview detail=total_entries]');
$this->assertEquals('0', $value);
GravityView_View::getInstance()->setTotalEntries(1000);
$value = do_shortcode('[gravityview detail=total_entries]');
$this->assertEquals('1,000', $value);
add_filter('gravityview/shortcode/detail/total_entries', '__return_empty_string');
GravityView_View::getInstance()->setTotalEntries(1000000);
$value = do_shortcode('[gravityview detail=total_entries]');
$this->assertEquals('', $value);
remove_filter('gravityview/shortcode/detail/total_entries', '__return_empty_string');
}
示例9: edit_entry_field_input
/**
* The Signature Addon only displays the output in the editable form if it thinks it's in the Admin or a form has been submitted
*
* @since 1.17
*
* @param string $field_content Always empty. Returning not-empty overrides the input.
* @param GF_Field $field
* @param string|array $value If array, it's a field with multiple inputs. If string, single input.
* @param int $lead_id Lead ID. Always 0 for the `gform_field_input` filter.
* @param int $form_id Form ID
*
* @return string Empty string forces Gravity Forms to use the $_POST values
*/
function edit_entry_field_input($field_content = '', $field, $value = '', $lead_id = 0, $form_id = 0)
{
$context = function_exists('gravityview_get_context') ? gravityview_get_context() : '';
if ('signature' !== $field->type || 'edit' !== $context) {
return $field_content;
}
// We need to fetch a fresh version of the entry, since the saved entry hasn't refreshed in GV yet.
$entry = GravityView_View::getInstance()->getCurrentEntry();
$entry = GFAPI::get_entry($entry['id']);
$entry_value = rgar($entry, $field->id);
$_POST["input_{$field->id}"] = $entry_value;
// Used when Edit Entry form *is* submitted
$_POST["input_{$form_id}_{$field->id}_signature_filename"] = $entry_value;
// Used when Edit Entry form *is not* submitted
return '';
// Return empty string to force using $_POST values instead
}
开发者ID:mgratch,项目名称:GravityView,代码行数:30,代码来源:class-gravityview-plugin-hooks-gravity-forms-signature.php
示例10: filter_search_criteria
/**
* Modify search criteria
* @param array $criteria Existing search criteria array, if any
* @param [type] $form_ids Form IDs for the search
* @param [type] $passed_view_id (optional)
* @return [type] [description]
*/
function filter_search_criteria($criteria, $form_ids = null, $passed_view_id = NULL)
{
global $gravityview_view;
if (is_admin() && (!defined('DOING_AJAX') || defined('DOING_AJAX') && !DOING_AJAX)) {
return $criteria;
}
$view_id = !empty($passed_view_id) ? $passed_view_id : GravityView_View::getInstance()->getViewId();
if (empty($view_id)) {
do_action('gravityview_log_error', 'GravityView_Advanced_Filtering[filter_search_criteria] Empty View ID.', $gravityview_view);
$criteria['search_criteria']['field_filters'][] = self::get_lock_filter();
$criteria['search_criteria']['field_filters']['mode'] = 'all';
return $criteria;
}
$view_filters = self::get_view_filter_vars($view_id);
if (!empty($view_filters) && is_array($view_filters)) {
do_action('gravityview_log_debug', 'GravityView_Advanced_Filtering[filter_search_criteria] about to add search criteria', $view_filters);
//sanitize filters - no empty search values
foreach ($view_filters as $k => $filter) {
// Don't use `empty()` because `0` is a valid value
if ($k !== 'mode' && (!isset($filter['value']) || $filter['value'] === '')) {
unset($view_filters[$k]);
}
}
// add advanced filters if defined
if (count($view_filters) > 1) {
do_action('gravityview_log_debug', 'GravityView_Advanced_Filtering[filter_search_criteria] Added search criteria', $view_filters);
foreach ($view_filters as $k => $filter) {
if ($k !== 'mode') {
$filter = self::parse_advanced_filters($filter, $view_id);
$criteria['search_criteria']['field_filters'][] = $filter;
} else {
$criteria['search_criteria']['field_filters']['mode'] = $filter;
}
}
}
} else {
do_action('gravityview_log_debug', 'GravityView_Advanced_Filtering[filter_search_criteria] No additional search criteria.');
}
return $criteria;
}
示例11:
<?php
/**
* Display Gravity Forms Quiz value Pass/Fail
*
* @package GravityView
* @subpackage GravityView/templates/fields
*/
$field = GravityView_View::getInstance()->getCurrentField();
// If there's no grade, don't continue
if (gv_empty($field['value'], false, false)) {
return;
}
/**
* @filter `gravityview/field/quiz_percent/format` Modify the format of the display of Quiz Score (Percent) field.
* @see http://php.net/manual/en/function.sprintf.php For formatting guide
* @param string $format Format passed to printf() function. Default `%d%%`, which prints as "{number}%". Notice the double `%%`, this prints a literal '%' character.
*/
$format = apply_filters('gravityview/field/quiz_percent/format', '%d%%');
printf($format, $field['value']);
示例12: add_columns_sort_links
/**
* Inject the sorting links on the table columns
*
* Callback function for hook 'gravityview/template/field_label'
* @see GravityView_API::field_label() (in includes/class-api.php)
*
* @since 1.7
*
* @param string $label Field label
* @param array $field Field settings
*
* @return string Field Label
*/
public function add_columns_sort_links($label = '', $field, $form)
{
/**
* Not a table-based template; don't add sort icons
* @since 1.12
*/
if (!preg_match('/table/ism', GravityView_View::getInstance()->getTemplatePartSlug())) {
return $label;
}
if (!$this->is_field_sortable($field['id'], $form)) {
return $label;
}
$sorting = GravityView_View::getInstance()->getSorting();
$class = 'gv-sort icon';
$sort_field_id = self::_override_sorting_id_by_field_type($field['id'], $form['id']);
$sort_args = array('sort' => $field['id'], 'dir' => 'asc');
if (!empty($sorting['key']) && (string) $sort_field_id === (string) $sorting['key']) {
//toggle sorting direction.
if ('asc' === $sorting['direction']) {
$sort_args['dir'] = 'desc';
$class .= ' gv-icon-sort-desc';
} else {
$sort_args['dir'] = 'asc';
$class .= ' gv-icon-sort-asc';
}
} else {
$class .= ' gv-icon-caret-up-down';
}
$url = add_query_arg($sort_args, remove_query_arg(array('pagenum')));
return '<a href="' . esc_url_raw($url) . '" class="' . $class . '" ></a> ' . $label;
}
示例13: get_files_array
/**
* Return an array of files prepared for output.
*
* Processes files by file type and generates unique output for each.
*
* Returns array for each file, with the following keys:
*
* `file_path` => The file path of the file, with a line break
* `html` => The file output HTML formatted
*
* @since 1.2
* @todo Support `playlist` shortcode for playlist of video/audio
* @usedby gravityview_get_files_array()
* @param string $value Field value passed by Gravity Forms. String of file URL, or serialized string of file URL array
* @param string $gv_class Field class to add to the output HTML
* @return array Array of file output, with `file_path` and `html` keys (see comments above)
*/
static function get_files_array($value, $gv_class)
{
$gravityview_view = GravityView_View::getInstance();
extract($gravityview_view->getCurrentField());
$output_arr = array();
// Get an array of file paths for the field.
$file_paths = rgar($field, 'multipleFiles') ? json_decode($value) : array($value);
// Process each file path
foreach ($file_paths as $file_path) {
// If the site is HTTPS, use HTTPS
if (function_exists('set_url_scheme')) {
$file_path = set_url_scheme($file_path);
}
// This is from Gravity Forms's code
$file_path = esc_attr(str_replace(" ", "%20", $file_path));
// If the field is set to link to the single entry, link to it.
$link = !empty($field_settings['show_as_link']) ? GravityView_API::entry_link($entry, $field) : $file_path;
// Get file path information
$file_path_info = pathinfo($file_path);
$html_format = NULL;
$disable_lightbox = false;
$disable_wrapped_link = false;
// Is this an image?
$image = new GravityView_Image(array('src' => $file_path, 'class' => 'gv-image gv-field-id-' . $field_settings['id'], 'alt' => $field_settings['label'], 'width' => gravityview_get_context() === 'single' ? NULL : 250));
$content = $image->html();
// The new default content is the image, if it exists. If not, use the file name as the content.
$content = !empty($content) ? $content : $file_path_info['basename'];
// If pathinfo() gave us the extension of the file, run the switch statement using that.
$extension = empty($file_path_info['extension']) ? NULL : strtolower($file_path_info['extension']);
switch (true) {
// Audio file
case in_array($extension, wp_get_audio_extensions()):
$disable_lightbox = true;
if (shortcode_exists('audio')) {
$disable_wrapped_link = true;
/**
* Modify the settings passed to the `wp_video_shortcode()` function
*
* @since 1.2
* @var array
*/
$audio_settings = apply_filters('gravityview_audio_settings', array('src' => $file_path, 'class' => 'wp-audio-shortcode gv-audio gv-field-id-' . $field_settings['id']));
/**
* Generate the audio shortcode
* @link http://codex.wordpress.org/Audio_Shortcode
* @link https://developer.wordpress.org/reference/functions/wp_audio_shortcode/
*/
$content = wp_audio_shortcode($audio_settings);
}
break;
// Video file
// Video file
case in_array($extension, wp_get_video_extensions()):
$disable_lightbox = true;
if (shortcode_exists('video')) {
$disable_wrapped_link = true;
/**
* Modify the settings passed to the `wp_video_shortcode()` function
*
* @since 1.2
* @var array
*/
$video_settings = apply_filters('gravityview_video_settings', array('src' => $file_path, 'class' => 'wp-video-shortcode gv-video gv-field-id-' . $field_settings['id']));
/**
* Generate the video shortcode
* @link http://codex.wordpress.org/Video_Shortcode
* @link https://developer.wordpress.org/reference/functions/wp_video_shortcode/
*/
$content = wp_video_shortcode($video_settings);
}
break;
// PDF
// PDF
case $extension === 'pdf':
// PDF needs to be displayed in an IFRAME
$link = add_query_arg(array('TB_iframe' => 'true'), $link);
break;
// if not image, do not set the lightbox (@since 1.5.3)
// if not image, do not set the lightbox (@since 1.5.3)
case !in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png')):
$disable_lightbox = true;
break;
}
//.........这里部分代码省略.........
示例14: enqueue_datepicker
/**
* Enqueue the datepicker script
*
* It sets the $gravityview->datepicker_class parameter
*
* @todo Use own datepicker javascript instead of GF datepicker.js - that way, we can localize the settings and not require the changeMonth and changeYear pickers.
* @return void
*/
public function enqueue_datepicker()
{
$gravityview_view = GravityView_View::getInstance();
wp_enqueue_script('jquery-ui-datepicker');
add_filter('gravityview_js_dependencies', array($this, 'add_datepicker_js_dependency'));
add_filter('gravityview_js_localization', array($this, 'add_datepicker_localization'), 10, 2);
$scheme = is_ssl() ? 'https://' : 'http://';
wp_enqueue_style('jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css');
/**
* @filter `gravityview_search_datepicker_class`
* Modify the CSS class for the datepicker, used by the CSS class is used by Gravity Forms' javascript to determine the format for the date picker. The `gv-datepicker` class is required by the GravityView datepicker javascript.
* @param string $css_class CSS class to use. Default: `gv-datepicker datepicker mdy` \n
* Options are:
* - `mdy` (mm/dd/yyyy)
* - `dmy` (dd/mm/yyyy)
* - `dmy_dash` (dd-mm-yyyy)
* - `dmy_dot` (dd.mm.yyyy)
* - `ymp_slash` (yyyy/mm/dd)
* - `ymd_dash` (yyyy-mm-dd)
* - `ymp_dot` (yyyy.mm.dd)
*/
$datepicker_class = apply_filters('gravityview_search_datepicker_class', 'gv-datepicker datepicker mdy');
$gravityview_view->datepicker_class = $datepicker_class;
}
示例15: test_no_results
/**
* @uses GravityView_API_Test::_override_no_entries_text_output()
* @covers GravityView_API::no_results()
*/
public function test_no_results()
{
global $gravityview_view;
$gravityview_view = GravityView_View::getInstance();
$gravityview_view->curr_start = false;
$gravityview_view->curr_end = false;
$gravityview_view->curr_search = false;
// Not in search by default
$this->assertEquals('No entries match your request.', GravityView_API::no_results(false));
$this->assertEquals('<p>No entries match your request.</p>' . "\n", GravityView_API::no_results(true));
// Pretend we're in search
$gravityview_view->curr_search = true;
$this->assertEquals('This search returned no results.', GravityView_API::no_results(false));
$this->assertEquals('<p>This search returned no results.</p>' . "\n", GravityView_API::no_results(true));
// Add the filter that modifies output
add_filter('gravitview_no_entries_text', array($this, '_override_no_entries_text_output'), 10, 2);
// Test to make sure the $is_search parameter is passed correctly
$this->assertEquals('SEARCH override the no entries text output', GravityView_API::no_results(false));
$gravityview_view->curr_search = false;
// Test to make sure the $is_search parameter is passed correctly
$this->assertEquals('NO SEARCH override the no entries text output', GravityView_API::no_results(false));
// Remove the filter for later
remove_filter('gravitview_no_entries_text', array($this, '_override_no_entries_text_output'));
}