BSF_Analytics::handle_optin_optout()
Process usage tracking opt out.
Description
Source
File: admin/bsf-analytics/class-bsf-analytics.php
public function handle_optin_optout() { if ( ! current_user_can( 'manage_options' ) ) { return; } $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : ''; if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) { return; } $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : ''; if ( 'yes' === $optin_status ) { $this->optin( $source ); } elseif ( 'no' === $optin_status ) { $this->optout( $source ); } wp_safe_redirect( remove_query_arg( array( $source . '_analytics_optin', $source . '_analytics_nonce', 'bsf_analytics_source', ) ) ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |