Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active March 13, 2017 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/bf4c9e0595489cd0fcf8b748309f552f to your computer and use it in GitHub Desktop.
Save cliffordp/bf4c9e0595489cd0fcf8b748309f552f to your computer and use it in GitHub Desktop.
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 );
@cliffordp
Copy link
Author

Submitted pull request at jackmcconnell/bnfw#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment