<?php

/**
 * Add new fields to the "Publish" metabox.
 *
 * @link    https://aiopodcasting.com
 * @since   1.0.0
 *
 * @package AiO_Podcast_Studio
 */

// Exit if accessed directly
if ( ! defined( 'WPINC' ) ) {
	die;
}

$shortcode = sprintf( '[aiopod_episodes podcast="%d"]', (int) $post_id );
?>
<hr />

<div class="aiopod aiopod-pub-action misc-pub-section misc-pub-add-episode">
	<span class="dashicons dashicons-microphone" aria-hidden="true"></span>
	<a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=aiopod_episodes&post_parent=' . (int) $post_id ) ); ?>">
		<?php esc_html_e( 'Add New Episode', 'aio-podcast-studio' ); ?>
	</a>
</div>

<div class="aiopod aiopod-pub-action misc-pub-section misc-pub-all-episodes">
	<span class="dashicons dashicons-playlist-audio" aria-hidden="true"></span>
	<a href="<?php echo esc_url( admin_url( 'edit.php?post_type=aiopod_episodes&post_parent=' . (int) $post_id ) ); ?>">
		<?php esc_html_e( 'View All Episodes', 'aio-podcast-studio' ); ?>
	</a>
</div>

<hr />

<?php do_action( 'aiopod_podcast_submitbox_misc_actions', $post ); ?>

<div class="aiopod misc-pub-section misc-pub-shortcode">
	<label class="aiopod-form-control">
		<strong><?php esc_html_e( 'Podcast Shortcode', 'aio-podcast-studio' ); ?></strong>
    	<input type="text" class="widefat" readonly="readonly" value="<?php echo esc_attr( $shortcode ); ?>" />
		<p class="description">
			<?php esc_html_e( 'Use this shortcode to display all episodes from this podcast on any page or post.', 'aio-podcast-studio' ); ?>
		</p>
    </label>
</div>
