'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
%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 ) ); }