I am lost as to how to create a dynamic button shortcode. Depending on the post ID a specific application form is served in a popup by clicking on a button labeled 'Apply'. At the bottom of the page is an apply button (which works). I would like to add another 'Apply' button on the right column with a custom shortcode.
function apply_button($atts, $content = null) {
extract(shortcode_atts(array('link' => 'https://recruitly.io/jobs/widget/apply/', 'target' => '' ), $atts));
return '<a class="button" href="'.$link.'" target="'.$target.'">' . do_shortcode($content) . '<span></span></a>';
}
add_shortcode('button', 'apply_button');
How would I add the php addition to the URL in 'link' within the shortcode above?
<?php echo recruitly_get_custom_post_value('jobId'); ?>
I help on what I am missing or done incorrectly would be appreciated!