Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

frm_no_entries_message

Last Updated: April 30, 2018

Knowledge Base → Extend Formidable Forms → Formidable Hooks - for Developers → Display Data → frm_no_entries_message
Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Use this hook to customize the "No Entries" message for a View.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Usage

add_filter( 'frm_no_entries_message', 'customize_no_entries_message', 10, 2);
function customize_no_entries_message( $message, $args )

Parameters

  • $message (string)
  • $args (array), => [ 'display' (object) ]

Examples

Remove message

This function will completely remove the no entries message for a View. Just replace 1066 with the ID of your View.

add_filter( 'frm_no_entries_message', 'remove_no_entries_message', 10, 2);
function remove_no_entries_message( $message, $args ) {
	if ( $args['display']->ID == 1066 ) {
		$message = '';
	}
	return $message;
}

Remove surrounding div

This function will remove the no entries message div and class. Just replace 1066 with the ID of your View.

add_filter( 'frm_no_entries_message', 'remove_no_entries_message_div', 10, 2);
function remove_no_entries_message_div( $message, $args ) {
	if ( $args['display']->ID == 1066 ) {
		$message = str_replace( '<div class="frm_no_entries">', '', $message );
                $message = substr( $message, 0, -6 );

	}
	return $message;
}

Display Specific Message Based on URL Parameter

This example will allow for a specific no entries message to be displayed if a user has filtered a View using a URL parameter, but no entries exist based on that filter. Replace 1378 with the ID of your View, and change the page URLs and messages as needed.

The URLs in this example are relative; therefore, if your URL is 'www.mysite.com/my-view/?status=pending', you would just use '/my-view/?status=pending'.

add_filter( 'frm_no_entries_message', 'remove_no_entries_message', 10, 2);
function remove_no_entries_message( $message, $args ) {
 $host = $_SERVER['REQUEST_URI'];
 if ( $args['display']->ID == 1378 ) {
   if ($host == "/your-relative-url/?status=pending") {
     $message = 'You have no pending entries.';
   }
   elseif ($host == "/your-relative-url/?status=incomplete") {
     $message = 'You have no incomplete entries.';
   }
 }
 return $message;
}
  • Usage
  • Parameters
  • Examples
    • Remove message
    • Remove surrounding div
    • Display Specific Message Based on URL Parameter
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

You do not have permission to view this form. Maybe you need to log in?

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable FormsĀ® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews