id || ! current_user_can( 'manage_pixelpair' ) ) { return; } $settings = ( new Repository() )->get(); if ( $settings['consent_notice_dismissed'] || $settings['deny_until_consent'] || ( new ConsentManager() )->tools() || ( ! $settings['meta_enabled'] && ! $settings['tiktok_enabled'] && ! $settings['gtm_enabled'] ) ) { return; } ?>
403 ) ); } $result = ( new Repository() )->update( array( 'consent_notice_dismissed' => true ) ); return is_wp_error( $result ) ? $result : true; } /** Handle the authenticated admin form. */ public function handle(): void { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- The nonce is verified by dismiss(). $nonce = isset( $_POST['_wpnonce'] ) && is_string( $_POST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) : ''; $result = $this->dismiss( $nonce ); if ( is_wp_error( $result ) ) { wp_die( esc_html( $result->get_error_message() ), '', array( 'response' => 403 ) ); } wp_safe_redirect( admin_url( 'admin.php?page=pixelpair' ) ); exit; } }