Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Display your menu item's selected locations to shortcode output
<?php
/**
* Display your selected location(s) within the WP Dispensary shortcodes
* Requires the "Dispensary Locations" add-on from WP Dispensary
*
* @link https://www.wpdispensary.com/downloads/dispensary-locations
*/
add_action( 'wpd_shortcode_inside_top', 'acme_mylocation' );
function acme_mylocation() {
global $post;
echo '<span class="mylocation">' . get_the_term_list( $post->ID, 'dispensary_locations', '', ', ' ) . '</span>';
wp_reset_postdata();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.