Last active
April 30, 2017 13:32
-
-
Save robertdevore/0a91a333b4bb2c3d6106d7124ed0e867 to your computer and use it in GitHub Desktop.
WP Dispensary - display categories at the bottom of the Details table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WPD - Display categories in the Data Details table | |
*/ | |
add_action( 'wpd_dataoutput_bottom', 'add_wpd_categories' ); | |
function add_wpd_categories() { ?> | |
<?php if ( in_array( get_post_type(), array( 'flowers' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'flowers_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php if ( in_array( get_post_type(), array( 'concentrates' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'concentrates_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php if ( in_array( get_post_type(), array( 'edibles' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'edibles_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php if ( in_array( get_post_type(), array( 'topicals' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'topicals_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php if ( in_array( get_post_type(), array( 'growers' ) ) ) { ?> | |
<tr><td><span>Categories:</span></td><td><?php echo get_the_term_list( $post->ID, 'growers_category', '', ', ' ); ?></td></tr> | |
<?php } ?> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment