manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $aster_vlogger_choices ) ? $input : $setting->default ); } function aster_vlogger_sanitize_switch( $input ) { if ( true === $input ) { return true; } else { return false; } } function aster_vlogger_sanitize_google_fonts( $input, $setting ) { $aster_vlogger_choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $aster_vlogger_choices ) ? $input : $setting->default ); } /** * Sanitize HTML input. * * @param string $input HTML input to sanitize. * @return string Sanitized HTML. */ function aster_vlogger_sanitize_html( $input ) { return wp_kses_post( $input ); } /** * Sanitize URL input. * * @param string $input URL input to sanitize. * @return string Sanitized URL. */ function aster_vlogger_sanitize_url( $input ) { return esc_url_raw( $input ); } // Sanitize Scroll Top Position function aster_vlogger_sanitize_scroll_top_position( $input ) { $valid_positions = array( 'bottom-right', 'bottom-left', 'bottom-center' ); if ( in_array( $input, $valid_positions ) ) { return $input; } else { return 'bottom-right'; // Default to bottom-right if invalid value } }