cliff
2/21/2017 - 9:29 PM

Renders all shortcodes for the BNFW plugin's email message, such as using with https://theeventscalendar.com/extensions/formatted-event-date

Renders all shortcodes for the BNFW plugin's email message, such as using with https://theeventscalendar.com/extensions/formatted-event-date-shortcode/

<?php

// NO LONGER NEEDED as of BNFW version 1.6.3 from March 13, 2017

/**
 * Renders all shortcodes for the BNFW plugin's email message, such as using with https://theeventscalendar.com/extensions/formatted-event-date-shortcode/
 * Note that BNFW version 1.6.2 does not run do_shortcode() at all so this adds such functionality. Also, its own shortcodes aren't *real* WordPress shortcodes; they're just str_replace's.
 * from https://gist.github.com/cliffordp/bf4c9e0595489cd0fcf8b748309f552f
 *
 * @link https://theeventscalendar.com/support/forums/topic/display-event-start-and-end-dates-in-an-email-using-the-bnfw/#post-1243308
 * @link https://wordpress.org/plugins/bnfw/
 * @link https://wordpress.org/support/topic/run-do_shortcode-before-bnfw_shortcodes_post/
 *
 * @return string
 */
function cliff_bnfw_actually_render_shortcodes( $message, $post_id ) {

	$message = do_shortcode( $message );

	return $message;
}

add_filter( 'bnfw_shortcodes_post', 'cliff_bnfw_actually_render_shortcodes', 10, 2 );