<?php

/**
 * Accordion: Distribution.
 *
 * @link    https://aiopodcasting.com
 * @since   1.0.0
 *
 * @package AiO_Podcast_Studio
 */

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

$new_feed_url = isset( $post_meta['new_feed_url'] ) ? $post_meta['new_feed_url'][0] : '';
$is_blocked   = isset( $post_meta['is_blocked'] ) ? $post_meta['is_blocked'][0] : 0;
?>
<div class="aiopod-form-controls">
	<!-- Field: Redirect URL -->
	<div id="aiopod-form-control-new_feed_url" class="aiopod-form-control">
		<label for="aiopod-field-new_feed_url" class="aiopod-form-label">
			<?php esc_html_e( 'Redirect URL', 'aio-podcast-studio' ); ?>
		</label>

		<div class="aiopod-form-field">
			<input type="text" name="new_feed_url" id="aiopod-field-new_feed_url" class="widefat" placeholder="https://www.newhost.com/podcastname/rss" value="<?php echo esc_attr( $new_feed_url ); ?>" />
		</div>

		<p class="description">
			<?php esc_html_e( 'If you\'re switching to a different podcast host, enter your new RSS feed URL here to redirect your listeners permanently.', 'aio-podcast-studio' ); ?>
		</p>
	</div>

	<!-- Field: Block from Directories -->
	<div id="aiopod-form-control-is_blocked" class="aiopod-form-control">
		<label for="aiopod-field-is_blocked" class="aiopod-form-label">
			<?php esc_html_e( 'Block from Directories', 'aio-podcast-studio' ); ?>
		</label>

		<label class="aiopod-form-field">
			<input type="checkbox" name="is_blocked" id="aiopod-field-is_blocked" value="1" <?php checked( $is_blocked, 1 ); ?> />
			<?php esc_html_e( 'Prevent this podcast from appearing in directories like Apple Podcasts, Spotify, and others.', 'aio-podcast-studio' ); ?>
		</label>
	</div>
</div>
