/** * Display custom track columns. * * @since 1.0.0 * * @param string $column_id The id of the column to display. * @param int $post_id Post ID. */ function audiotheme_track_display_columns($column_name, $post_id) { switch ($column_name) { case 'artist': echo get_post_meta($post_id, '_audiotheme_artist', true); break; case 'download': if (is_audiotheme_track_downloadable($post_id)) { echo '<img src="' . AUDIOTHEME_URI . 'admin/images/download.png" width="16" height="16">'; } break; case 'file': $url = get_audiotheme_track_file_url($post_id); if ($url) { printf('<a href="%1$s" target="_blank">%2$s</a>', esc_url($url), '<img src="' . AUDIOTHEME_URI . 'admin/images/music-note.png" width="16" height="16">'); } break; case 'purchase': $url = get_audiotheme_track_purchase_url($post_id); if ($url) { printf('<a href="%1$s" target="_blank"><img src="' . AUDIOTHEME_URI . 'admin/images/link.png" width="16" height="16"></a>', esc_url($url)); } break; case 'record': $track = get_post($post_id); $record = get_post($track->post_parent); if ($record) { printf('<a href="%1$s">%2$s</a>', get_edit_post_link($record->ID), apply_filters('the_title', $record->post_title)); } break; } }
<span class="audiotheme-track-meta"> <span class="jp-current-time">-:--</span> </span> </span> </li> <?php enqueue_audiotheme_tracks(get_the_ID(), 'record'); ?> </ol> </div><!-- /.tracklist-section --> <?php $download_url = is_audiotheme_track_downloadable(); $purchase_url = get_audiotheme_track_purchase_url(); if ($download_url || $purchase_url) { ?> <div class="audiotheme-record-links audiotheme-track-links"> <ul class="audiotheme-record-links-list"> <?php if ($download_url) { ?> <li class="audiotheme-record-links-item"> <a href="<?php echo esc_url($download_url); ?> " class="audiotheme-record-link" itemprop="url" target="_blank"><?php _e('Download', 'audiotheme'); ?> </a>
if (!empty($title)) { printf(' <a href="%s">%s</a>', esc_url(get_permalink($post->ID)), $before_title . $title . $after_title); } ?> <?php if (!empty($link_text)) { $text .= sprintf(' <a class="more-link" href="%s">%s</a>', esc_url(get_permalink($post->ID)), $link_text); } if (!empty($text)) { echo '<div class="widget-description">' . wpautop($text) . '</div>'; } ?> <?php $purchase_url = get_audiotheme_track_purchase_url($post->ID); $download_url = is_audiotheme_track_downloadable($post->ID); if ($purchase_url || $download_url) { ?> <div class="meta-links"> <h2 class="screen-reader-text"><?php esc_html_e('Track Links', 'huesos'); ?> </h2> <ul> <?php if ($purchase_url) { ?> <li><a class="button" href="<?php echo esc_url($purchase_url); ?>