Created
August 13, 2021 17:10
-
-
Save wpmudev-sls/c6b490cdb9eaa43e1e2fd3e228874740 to your computer and use it in GitHub Desktop.
[Forminator] Fix Trello Empty Due Date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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