Пример #1
0
</span>

						<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');
            ?>
Пример #2
0
/**
 * 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;
    }
}
Пример #3
0
						<li id="track-<?php 
            echo $track->ID;
            ?>
" class="audiotheme-track" itemprop="track" itemscope itemtype="http://schema.org/MusicRecording">
							<span class="audiotheme-track-info audiotheme-track-cell">
								<a href="<?php 
            echo esc_url(get_permalink($track->ID));
            ?>
" itemprop="url" class="audiotheme-track-title"><span itemprop="name"><?php 
            echo get_the_title($track->ID);
            ?>
</span></a>

								<span class="audiotheme-track-meta">
									<?php 
            if ($download_url = is_audiotheme_track_downloadable($track->ID)) {
                ?>
										<a href="<?php 
                echo esc_url($download_url);
                ?>
" class="audiotheme-track-download-link"><?php 
                _e('Download', 'audiotheme');
                ?>
</a>
									<?php 
            }
            ?>

									<span class="jp-current-time">-:--</span>
								</span>
							</span>
Пример #4
0
/**
 * Tracklist editor.
 *
 * @since 1.0.0
 */
function audiotheme_edit_record_tracklist()
{
    global $post;
    wp_enqueue_script('audiotheme-media');
    $tracks = get_audiotheme_record_tracks($post->ID);
    if ($tracks) {
        foreach ($tracks as $key => $track) {
            $tracks[$key] = array('key' => $key, 'id' => $track->ID, 'title' => esc_attr($track->post_title), 'artist' => esc_attr(get_post_meta($track->ID, '_audiotheme_artist', true)), 'fileUrl' => esc_attr(get_post_meta($track->ID, '_audiotheme_file_url', true)), 'downloadable' => is_audiotheme_track_downloadable($track->ID), 'purchaseUrl' => esc_url(get_post_meta($track->ID, '_audiotheme_purchase_url', true)));
        }
    }
    require AUDIOTHEME_DIR . 'modules/discography/admin/views/edit-record-tracklist.php';
}
Пример #5
0
    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);
        ?>
" itemprop="url"><?php