plugin_screen_hook_suffix = add_submenu_page( 'amazon_ai', 'Podcast', 'Podcast', 'manage_options', 'amazon_ai_podcast', array( $this, 'amazonai_gui' ));
}
public function amazonai_gui()
{
?>
Podcast - Amazon Pollycast
common = new AmazonAI_Common();
$this->common->init();
add_settings_section('amazon_ai_podcast', "Amazon Pollycast configuration", array($this,'podcast_gui'), 'amazon_ai_podcast');
add_settings_field( 'amazon_polly_podcast_enabled', __( 'Pollycast enabled:', 'amazonpolly' ), array( $this, 'podcast_enabled_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_enabled' ) );
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_enabled');
if ( $this->common->is_podcast_enabled() ) {
add_settings_field( 'amazon_polly_podcast_email', __( 'iTunes contact email:', 'amazonpolly' ), array( $this, 'podcast_email_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_email' ) );
add_settings_field( 'amazon_polly_podcast_category', __( 'iTunes category:', 'amazonpolly' ), array( $this, 'podcast_category_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_category' ) );
add_settings_field( 'amazon_polly_podcast_explicit', __( 'iTunes explicit content:', 'amazonpolly' ), array( $this, 'podcast_explicit_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_explicit' ) );
add_settings_field( 'amazon_polly_podcast_icon', __( 'iTunes image:', 'amazonpolly' ), array( $this, 'podcast_icon_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_icon' ) );
add_settings_field( 'amazon_polly_podcast_feedsize', __( 'Feed size:', 'amazonpolly' ), array( $this, 'podcast_feedsize_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_feedsize' ) );
add_settings_field( 'amazon_polly_podcast_post_cat', __( 'Post categories:', 'amazonpolly' ), array( $this, 'podcast_post_cat_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_post_cat' ) );
add_settings_field( 'amazon_polly_podcast_author', __( 'Author:', 'amazonpolly' ), array( $this, 'podcast_author_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_author' ) );
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_email');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_category');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_explicit');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_icon');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_feedsize');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_post_cat');
register_setting('amazon_ai_podcast', 'amazon_polly_podcast_author');
}
}
/**
* Render the possibility for specify author of the feed.
*
* @since 2.0.6
*/
public function podcast_author_gui() {
$value = $this->common->get_podcast_author();
echo '';
}
/**
* Render the possibility for specify category of posts which will be added in feed.
*
* @since 2.0.4
*/
public function podcast_post_cat_gui() {
$value = get_option( 'amazon_polly_podcast_post_cat' );
echo '';
}
/**
* Render UI for setting Amazon Pollycast feedsize
*
* @since 2.0.3
*/
public function podcast_feedsize_gui() {
$value = $this->common->get_feed_size();
echo '';
}
/**
* Render the Update All input for this plugin
*
* @since 1.0.0
*/
public function podcast_icon_gui() {
$query['autofocus[section]'] = 'amazonpolly';
$section_link = add_query_arg( $query, admin_url( 'customize.php' ) );
echo 'Upload a podcast icon using the Customizer.
';
}
/**
* Render the Update All input for this plugin
*
* @since 1.0.0
*/
public function podcast_explicit_gui() {
$select_explicits = array(
'yes',
'no',
);
$selected_explicit = get_option( 'amazon_polly_podcast_explicit' );
echo '';
}
/**
* Render the Update All input for this plugin
*
* @since 1.0.0
*/
public function podcast_category_gui() {
$default_category = 'News & Politics';
$select_categories = array(
'Arts',
'Business',
'Comedy',
'Education',
'Games & Hobbies',
'Government & Organizations',
'Health',
'Kids',
'Music',
'News & Politics',
'Religion & Spirituality',
'Science & Medicine',
'Society & Culture',
'Sports & Recreation',
'Technology',
'TV & Film',
);
$selected_category = get_option( 'amazon_polly_podcast_category' );
if ( ! $selected_category ) {
$selected_category = 'News & Politics';
}
echo '';
}
/**
* Render the Update All input for this plugin
*
* @since 1.0.0
*/
public function podcast_email_gui() {
$selected_email = get_option( 'amazon_polly_podcast_email' );
echo '';
}
/**
* Render the Podcast enabled input.
*
* @since 1.0.7
*/
public function podcast_enabled_gui() {
if ($this->common->validate_amazon_polly_access()) {
echo 'common->checked_validator( 'amazon_polly_podcast_enabled' ) . '> ';
echo 'If enabled, Amazon Pollycast will be generated
';
} else {
echo 'Please verify your AWS Credentials are accurate
';
}
}
function podcast_gui() {
if ( $this->common->is_podcast_enabled() ) {
echo 'Amazon Pollycast available at: ' . esc_html( get_feed_link( 'amazon-pollycast' ) ) . '
';
echo 'Submit your Amazon Pollycast to iTunes iConnect: ' . esc_html( 'https://podcastsconnect.apple.com/' ) . '
';
}
}
}