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_title', __( 'Podcast title:', 'amazonpolly' ), array( $this, 'podcast_title_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_title' ) ); add_settings_field( 'amazon_polly_podcast_description', __( 'Podcast description:', 'amazonpolly' ), array( $this, 'podcast_description_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_description' ) ); add_settings_field( 'amazon_polly_podcast_author', __( 'iTunes author name:', 'amazonpolly' ), array( $this, 'podcast_author_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_author' ) ); 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_https', __( 'Use HTTPS for audio files:', 'amazonpolly' ), array( $this, 'podcast_https_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_https' ) ); add_settings_field( 'amazon_polly_podcast_button', __( 'Show subscribe button:', 'amazonpolly' ), array( $this, 'podcast_subscribe_button_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_button' ) ); add_settings_field( 'amazon_polly_podcast_button_link', __( 'Subscribe link:', 'amazonpolly' ), array( $this, 'podcast_subscribe_button_link_gui' ), 'amazon_ai_podcast', 'amazon_ai_podcast', array( 'label_for' => 'amazon_polly_podcast_button_link' ) ); register_setting('amazon_ai_podcast', 'amazon_polly_podcast_title'); register_setting('amazon_ai_podcast', 'amazon_polly_podcast_description'); register_setting('amazon_ai_podcast', '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_https'); register_setting('amazon_ai_podcast', 'amazon_polly_podcast_button'); register_setting('amazon_ai_podcast', 'amazon_polly_podcast_button_link'); } } /** * Render the Title input * * @since 3.0.2 */ public function podcast_title_gui() { $value = get_option( 'amazon_polly_podcast_title' ); echo sprintf('', esc_attr( $value )); echo sprintf('

If not specified, will be used default title: %s

', get_wp_title_rss()); } /** * Render the Description input * * @since 3.0.2 */ public function podcast_description_gui() { $value = get_option( 'amazon_polly_podcast_description' ); echo sprintf('', esc_attr( $value )); echo sprintf( '

If not specified, will be used default description: %s

', get_bloginfo('description') ?: get_bloginfo('title') ); } /** * Render input for deciding if subscribe button should be displayed * * @since 3.0.2 */ public function podcast_subscribe_button_gui() { echo 'common->checked_validator( 'amazon_polly_podcast_button' ) . '> '; } /** * Render the HTTPS podcast input. * * @since 4.0.5 */ public function podcast_https_gui() { echo 'common->checked_validator( 'amazon_polly_podcast_https' ) . '> '; } /** * Render the possibility for specify author of the feed. * * @since 2.0.6 */ public function podcast_subscribe_button_link_gui() { $value = $this->common->get_subscribe_link(); echo ''; } /** * 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/' ) . '

'; } } }