* @since 3.0.0 */ namespace Beyondwords\Wordpress\Component\Settings\Fields\ProjectId; use Beyondwords\Wordpress\Component\Settings\SettingsUtils; /** * ProjectId * * @since 3.0.0 */ defined('ABSPATH') || exit; class ProjectId { /** * Option name. * * @since 5.0.0 */ public const OPTION_NAME = 'beyondwords_project_id'; /** * Init. * * @since 4.0.0 * @since 6.0.0 Make static. */ public static function init() { add_action('admin_init', [self::class, 'addSetting']); } /** * Init setting. * * @since 3.0.0 * @since 6.0.0 Make static. * * @return void */ public static function addSetting() { register_setting( 'beyondwords_credentials_settings', self::OPTION_NAME, [ 'default' => '', 'sanitize_callback' => [self::class, 'sanitize'], ] ); add_settings_field( 'beyondwords-project-id', __('Project ID', 'speechkit'), [self::class, 'render'], 'beyondwords_credentials', 'credentials' ); } /** * Render setting field. * * @since 3.0.0 * @since 6.0.0 Make static. * * @return void **/ public static function render() { $value = get_option(self::OPTION_NAME); ?>