'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); register_setting( 'wpthemoon_settings', 'wpthemoon_target_audience', array( 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); add_settings_section( 'wpthemoon_api_section', __( 'API Connection Settings', 'wpthemoon' ), array( $this, 'section_callback' ), 'wpthemoon' ); add_settings_field( 'wpthemoon_api_key', __( 'API Key', 'wpthemoon' ), array( $this, 'api_key_callback' ), 'wpthemoon', 'wpthemoon_api_section' ); add_settings_field( 'wpthemoon_target_audience', __( 'Target Audience', 'wpthemoon' ), array( $this, 'target_audience_callback' ), 'wpthemoon', 'wpthemoon_api_section' ); } public function section_callback() { echo '

' . sprintf( __( 'Please enter the API Key obtained from the WPTheMoon official website.', 'wpthemoon' ), 'https://www.wpthemoon.com/settings/api-keys' ) . '

'; } public function api_key_callback() { $api_key = get_option( 'wpthemoon_api_key' ); echo ''; echo '

' . esc_html__( 'Your API Key is used for authentication and credits settlement. Please keep it safe.', 'wpthemoon' ) . '

'; } public function target_audience_callback() { $target_audience = get_option( 'wpthemoon_target_audience' ); echo ''; echo '

' . esc_html__( 'Optional. Defining your target audience helps the AI generate content that is more relevant and engaging for your specific readers.', 'wpthemoon' ) . '

'; } }