_e('Genre', 'audiotheme');
        ?>
</span>
						<span itemprop="genre"><?php 
        echo esc_html($genre);
        ?>
</span>
					</li>
				<?php 
    }
    ?>
			</ul><!-- /.record-meta -->
		</header>

		<?php 
    if ($links = get_audiotheme_record_links()) {
        ?>

			<div class="audiotheme-record-links">
				<h2 class="audiotheme-record-links-title"><?php 
        _e('Purchase', 'audiotheme');
        ?>
</h2>
				<ul class="audiotheme-record-links-list">
					<?php 
        foreach ($links as $link) {
            printf('<li class="audiotheme-record-links-item"><a href="%s" class="audiotheme-record-link"%s itemprop="url">%s</a></li>', $link['url'], false === strpos($link['url'], home_url()) ? ' target="_blank"' : '', $link['name']);
        }
        ?>
				</ul>
			</div><!-- /.record-links -->
Exemple #2
0
/**
 * Record details meta box.
 *
 * @since 1.0.0
 *
 * @param WP_Post $post The record post object being edited.
 */
function audiotheme_record_details_meta_box($post)
{
    // Nonce to verify intention later.
    wp_nonce_field('update-record_' . $post->ID, 'audiotheme_record_nonce');
    $record_links = (array) get_audiotheme_record_links($post->ID);
    $record_links = empty($record_links) ? array('') : $record_links;
    $record_link_sources = get_audiotheme_record_link_sources();
    $record_link_source_names = array_keys($record_link_sources);
    sort($record_link_source_names);
    require AUDIOTHEME_DIR . 'modules/discography/admin/views/edit-record-details.php';
}
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 
if ($links = get_audiotheme_record_links($post->ID)) {
    ?>

	<div class="meta-links">
		<h3 class="screen-reader-text"><?php 
    esc_html_e('Record Links', 'huesos');
    ?>
</h3>
		<ul>
			<?php 
    foreach ($links as $link) {
        printf('<li><a class="button js-maybe-external" href="%s" itemprop="url">%s</a></li>', esc_url($link['url']), esc_html($link['name']));
    }
    ?>
		</ul>
	</div>