Created
March 21, 2012 19:52
-
-
Save zanematthew/2152046 to your computer and use it in GitHub Desktop.
temp
This file contains hidden or 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 | |
if ( ! function_exists( 'wp_media_cart_get_the_term_list' ) ) : | |
function wp_media_cart_get_the_term_list( $attacment_id=null ) { | |
if ( is_array( $attacment_id ) ) | |
extract( $attacment_id ); | |
$taxonomy = strtolower( trim( str_replace( " ", "-", $taxonomy ) ) ); | |
$terms = wp_get_post_terms( $post_id, $taxonomy ); | |
$my_link = null; | |
if ( empty( $extra_class ) ) { | |
$extra_class = null; | |
} | |
if ( $terms && !is_wp_error( $terms ) ) : ?> | |
<fieldset class="<?php echo $taxonomy; ?>-container"> | |
<legend class="zm-base-title"><?php echo $taxonomy; ?></legend> | |
<?php foreach( $terms as $term ) : ?> | |
<label for="<?php echo $term->name; ?>" class="zm-base-<?php print $taxonomy; ?>-<?php print $term->slug; ?>"> | |
<input | |
type="radio" | |
value="<?php echo $prepend; ?><?php echo $term->name; ?>" | |
class="taxonomy-<?php echo $taxonomy; ?> term-<?php echo $term->slug; ?> <?php echo $taxonomy; ?>-<?php echo $term->term_id; ?>" | |
data-value="<?php echo $term->slug; ?>" | |
data-taxonomy="<?php echo $taxonomy; ?>" | |
data-name="<?php echo $term->name; ?>" | |
id="<?php echo $taxonomy; ?>-<?php echo $term->slug; ?>" | |
name="<?php echo $taxonomy; ?>" | |
<?php echo $selected; ?> /> | |
<?php echo $term->name; ?> | |
</label> | |
<?php endforeach; ?> | |
</fieldset> | |
<?php endif; | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment