', esc_attr($type), esc_attr($option_name), esc_attr($option_name), esc_attr($option_value), esc_attr($placeholder) ); if($description) echo '

'.$description.'

'; } public function registerSettingsAction() { add_settings_section( 'ahjwtauth-sign-in-widget-options-section', '', null, 'ahjwtauth-sign-in-widget' ); register_setting('ahjwtauth-sign-in-widget', 'ahjwtauth-private-secret', array( 'type' => 'string', 'show_in_rest' => false, )); register_setting('ahjwtauth-sign-in-widget', 'ahjwtauth-jwks-url', array( 'type' => 'string', 'show_in_rest' => true, )); register_setting('ahjwtauth-sign-in-widget', 'ahjwtauth-jwt-header', array( 'type' => 'string', 'show_in_rest' => true, 'default' => 'Authorization', )); add_settings_field( 'ahjwtauth-private-secret', 'JWT Private Secret', function() { $this->optionsPageTextInputAction('ahjwtauth-private-secret', 'text', __('Paste your JWT private secret here.', 'ah-jwt-auth'), __('This secret is used for verifying the token (use this field or the "JWKS URL", not both).', 'ah-jwt-auth')); }, 'ahjwtauth-sign-in-widget', 'ahjwtauth-sign-in-widget-options-section' ); add_settings_field( 'ahjwtauth-jwks-url', 'JWKS URL', function() { $this->optionsPageTextInputAction('ahjwtauth-jwks-url', 'text', __('Enter the JWKS URL to validate the JWT.', 'ah-jwt-auth'), __('The retreived JWKS is used for verifying the token (use this field or the "JWT Private Secret", not both)', 'ah-jwt-auth')); }, 'ahjwtauth-sign-in-widget', 'ahjwtauth-sign-in-widget-options-section' ); add_settings_field( 'ahjwtauth-jwt-header', 'JWT Header', function() { $this->optionsPageTextInputAction('ahjwtauth-jwt-header', 'text', __('Enter the HTTP header that contains the JWT.', 'ah-jwt-auth'), __('The JWT will be retrieved from the specified HTTP header. This defaults to the "Authorization" header.', 'ah-jwt-auth')); }, 'ahjwtauth-sign-in-widget', 'ahjwtauth-sign-in-widget-options-section' ); } }