Help with custom shortcode
-
Hi, I need to create a custom shortcode for BNFW that displays the date a year from today. I already created the shortcode using add_shortcode() but don’t understand the instructions on the BNFW site about how to add that new shortcode. You suggest using this code as a starting point:
add_filter('wp_mail', function($args) { $args['message'] = do_shortcode($args['message']); return $args; }, 1, 1);But how would I incorporate the new shortcode into that filter? For reference, the code I’m using to generate the new shortcode is:
function displayFutureDate() { $futureDate = date('F j, Y', strtotime('+1 year')); return $futureDate; } add_shortcode('future_date', 'displayFutureDate');
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘Help with custom shortcode’ is closed to new replies.