Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wpmudev-sls/c6b490cdb9eaa43e1e2fd3e228874740 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/c6b490cdb9eaa43e1e2fd3e228874740 to your computer and use it in GitHub Desktop.
[Forminator] Fix Trello Empty Due Date
<?php
/**
* Plugin Name: [Forminator] Fix Trello Empty Due Date
* Plugin URI: https://premium.wpmudev.org
* Description: When Trello due date is not set on the form submission, the data isn't sent to Trello - this snippet fixes this problem.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* Jira Task: SLS-2465
* License: GPLv2 or later
*
* @package WPMUDEV_Forminator_Fix_Trello_Empty_Due_Date
*/
defined( 'ABSPATH' ) || exit;
function wpmudev_forminator_fix_trello_empty_due_date( $args ) {
if ( empty( trim( $args['due'] ) ) ) {
$args['due'] = null;
}
return $args;
}
add_filter( 'forminator_addon_trello_create_card_args', 'wpmudev_forminator_fix_trello_empty_due_date' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment