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_export_content

Last Updated: July 16, 2020

Knowledge Base → Extend Formidable Forms → Formidable Hooks - for Developers → Add Ons → Table View to CSV → frm_export_content
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.

Make changes to the content used in the exported CSV.

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

Usage

add_filter( 'frm_export_content', 'change_exported_cell' );
function change_exported_cell( $content )

Parameters

  • $content (string) - The value to be exported.

Examples

Remove "View more" link

Exporting views includes all of the content. This example removes a "View more" since it isn't needed in the view.

add_filter( 'frm_export_content', 'change_exported_cell' );
function change_exported_cell( $content ) {
  $content = str_replace( 'View more', ' ', $content );
  return $content;
}

Replace ampersand HTML in CSV export

Use the code below to replace the ampersand HTML in exported field.

add_filter( 'frm_export_content', 'replace_ampersand' );
function replace_ampersand( $content ) {
  $content = str_replace( 'amp;', ' ', $content );
  return $content;
}

Add apostrophe for phone numbers

Use this code snippet to add the apostrophe if the value looks like anything but a number with some periods or dashes. If you have removed '+' from the risky characters list, this will add the apostrophe for potentially risky cells but removes the apostrophe before the '+' sign for phone numbers.

add_filter(
	'frm_export_content',
	function( $cell ) {
		if ( '+' === substr( $cell, 0, 1 ) && ! cell_is_phone_number( $cell )  ) {
			return "'" . $cell;
		}
		return $cell;
	}
);

function cell_is_phone_number( $cell ) {
	$substring = substr( $cell, 1 );
	$substring = str_replace( array( '-', '.' ), array( '', '' ), $substring );
	return is_numeric( $substring );
}

frm-export-content Phone Numberfrm-export-content Add apostrophe

  • Usage
  • Parameters
  • Examples
    • Remove "View more" link
    • Replace ampersand HTML in CSV export
    • Add apostrophe for phone numbers
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.

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