Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_dynamic_field_include_drafts

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.

As of version 6.9, dynamic fields will only include data from submitted entries. Draft entries, in-progress entries, and abandoned entries will be ignored by default. Use this filter to modify the default behavior with support for the new options.

Usage

add_filter( 'frm_dynamic_field_include_drafts', 'dynamic_include_draft_entries' );

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $include (string): Accepts exclude (default), include, and draft_only
  • $args (array): Contains field (array)

Examples

Include draft entries only

Use this code snippet to only include data from draft entries.

add_filter( 'frm_dynamic_field_include_drafts', 'dynamic_include_draft_entries' );
function dynamic_include_draft_entries( $include ) {
    return 'drafts_only'; // Or return FrmProDynamicFieldsController::DRAFTS_ONLY;
}

Include both drafts and submitted entries

Use this code snippet to include both draft and submitted entries.

add_filter( 'frm_dynamic_field_include_drafts', 'dynamic_include_entries' );
function dynamic_include_entries( $include ) {
    return 'include'; // Or return FrmProDynamicFieldsController::INCLUDE_DRAFTS;
}

Include only draft entries for specific dynamic field

Use this code snippet to only include data from draft entries for a specific dynamic field.

add_filter( 'frm_dynamic_field_include_drafts', 'specific_dynamic_include_draft', 10, 2 );
function specific_dynamic_include_draft( $include, $args ) {
	if ( 13 == $args['field']['id'] ) { // Replace 13 with the ID of the dynamic field
		return 'drafts_only'; // Or return FrmProDynamicFieldsController::DRAFTS_ONLY;
	}
	return $include;
}

Include abandoned entries only

Use this code snippet to only include data from abandoned entries.

add_filter(
	'frm_dynamic_field_include_drafts',
	function() {
		return FrmProDynamicFieldsController::ABANDONED_ONLY;
	}
);

Include in-progress entries only

Use this code snippet to only include data from in-progress entries.

add_filter(
	'frm_dynamic_field_include_drafts',
	function() {
		return FrmProDynamicFieldsController::IN_PROGRESS_ONLY;
	}
);

Include all entries

Use this code snippet to include data from all entries.

add_filter(
	'frm_dynamic_field_include_drafts',
	function() {
		return FrmProDynamicFieldsController::INCLUDE_ALL;
	}
);
Was this article helpful? *

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.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Special offer unlocked.
    Get 55% OFF!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms