Adding Your Own Custom Shortcodes


If you would like to add your own custom shortcodes to BNFW, you can do so by adding the first code block below as an example shortcode, followed by the second code block. These are added to your functions.php file.
This will inform BNFW of the new shortcode so that you can use it in your BNFW notifications.

If you need help with this, you may need to enlist a developer to write the code you need to add the shortcode you want to output in the message body of your notification(s).

function bnfw_shortcode_futuredate() {
$future_date = date( 'F j, Y', strtotime( '+1 year' ) );
return $future_date;
add_shortcode( 'future_date', 'bnfw_shortcode_futuredate' );
}, 1, 1 );

add_filter( 'wp_mail', function( $args ) {
$args['message'] = do_shortcode( $args['message'] );
return $args;
}, 1, 1 );