'array', 'sanitize_callback' => 'webtospeech_sanitize_settings', 'default' => webtospeech_default_settings(), ) ); add_settings_section( 'webtospeech_account', __( 'Your site', 'webtospeech' ), 'webtospeech_render_account_section', WEBTOSPEECH_PAGE ); add_settings_section( 'webtospeech_player', __( 'Player', 'webtospeech' ), '__return_false', WEBTOSPEECH_PAGE ); add_settings_field( 'webtospeech_site_key', __( 'Site key', 'webtospeech' ), 'webtospeech_render_site_key_field', WEBTOSPEECH_PAGE, 'webtospeech_account', array( 'label_for' => 'webtospeech_site_key' ) ); add_settings_field( 'webtospeech_verification_token', __( 'Verification token', 'webtospeech' ), 'webtospeech_render_verification_token_field', WEBTOSPEECH_PAGE, 'webtospeech_account', array( 'label_for' => 'webtospeech_verification_token' ) ); add_settings_field( 'webtospeech_post_types', __( 'Add the player to', 'webtospeech' ), 'webtospeech_render_post_types_field', WEBTOSPEECH_PAGE, 'webtospeech_player' ); add_settings_field( 'webtospeech_position', __( 'Position', 'webtospeech' ), 'webtospeech_render_position_field', WEBTOSPEECH_PAGE, 'webtospeech_player' ); add_settings_field( 'webtospeech_theme', __( 'Theme', 'webtospeech' ), 'webtospeech_render_theme_field', WEBTOSPEECH_PAGE, 'webtospeech_player', array( 'label_for' => 'webtospeech_theme' ) ); } /** * Add the settings page under Settings. */ function webtospeech_add_settings_page() { add_options_page( __( 'WebtoSpeech', 'webtospeech' ), __( 'WebtoSpeech', 'webtospeech' ), 'manage_options', WEBTOSPEECH_PAGE, 'webtospeech_render_settings_page' ); } /** * Add a Settings link to the plugin's row on the Plugins screen. * * @param array $links The row's links. * @return array */ function webtospeech_plugin_action_links( $links ) { $settings = sprintf( '%s', esc_url( admin_url( 'options-general.php?page=' . WEBTOSPEECH_PAGE ) ), esc_html__( 'Settings', 'webtospeech' ) ); return array_merge( array( 'settings' => $settings ), $links ); } /** * A link to a page on webtospeech.app. * * @param string $path The page's path. * @return string */ function webtospeech_service_url( $path ) { return WEBTOSPEECH_SERVICE_URL . $path; } /** * Draw the settings page. */ function webtospeech_render_settings_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } ?>

  1. ' . esc_html__( 'Sign up at webtospeech.app', 'webtospeech' ) . '' ); ?>
  2. ' . esc_html__( 'Settings → Sites', 'webtospeech' ) . '' ); ?>

$type ) : ?>

__( 'Above the content', 'webtospeech' ), 'below' => __( 'Below the content', 'webtospeech' ), ); ?>
$label ) : ?>
__( 'Match the reader’s system', 'webtospeech' ), 'light' => __( 'Light', 'webtospeech' ), 'dark' => __( 'Dark', 'webtospeech' ), ); ?> %s

%s

', esc_html__( 'Posts on this site include an audio player from WebtoSpeech (webtospeech.app), which reads the post aloud. When you view a post, your browser loads the player from webtospeech.app and sends it the post’s address, title and last-updated date. Like any web request, this also reveals your IP address and browser details to WebtoSpeech. The player does not set cookies.', 'webtospeech' ), sprintf( /* translators: %s: link to WebtoSpeech's privacy policy */ esc_html__( 'See WebtoSpeech’s privacy policy: %s', 'webtospeech' ), '' . esc_html( webtospeech_service_url( '/privacy' ) ) . '' ) ); wp_add_privacy_policy_content( __( 'WebtoSpeech', 'webtospeech' ), wp_kses_post( $content ) ); }