';
}
}
/**
* Display Polly GUI on page for saving new post.
*
* @since 2.5.0
* @param string $post New post.
*/
function display_polly_gui($post) {
$nonce = wp_create_nonce( 'amazon-polly' );
echo '';
$common = new AmazonAI_Common();
$common->init();
// Check if Text-To-Speech (Amazon Polly) functionality is enabled.
if ( $common->is_polly_enabled() ) {
// Check if Amazon Polly is enabled for specific post.
// 1 - Means that it's enabled for post
// 0 - Means that it's not enabled for the post
// No value - Means that it's new post
$is_polly_enabled_for_post = get_post_meta( $post->ID, 'amazon_polly_enable', true );
if ( '1' === $is_polly_enabled_for_post ) {
$polly_checked = 'checked';
} elseif ( '0' === $is_polly_enabled_for_post ) {
$polly_checked = '';
} else {
if ( $common->is_polly_enabled_for_new_posts() ) {
$polly_checked = 'checked';
} else {
$polly_checked = '';
}
}
$post_options_visibility = '';
echo '