Black Friday / Cyber Monday Weekend Sale!

25 - 28 November 2022

Sale ends in:

Days
Hours
Minutes
Seconds


Use code BFCM2022 for 40% off at the checkout.

Adding Your Own Custom Shortcodes

Updated

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).

1
2
3
4
5
6
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 );
1
2
3
4
add_filter( 'wp_mail', function( $args ) {
$args['message'] = do_shortcode( $args['message'] );
return $args;
}, 1, 1 );