Tribe__Events__Aggregator__Settings::maybe_clear_eb_credentials( WP_Screen $screen )
Hooked to current_screen, this method identifies whether or not eb credentials should be cleared
Contents
Parameters
- $screen
-
(WP_Screen) (Required)
Source
File: src/Tribe/Aggregator/Settings.php
public function maybe_clear_eb_credentials( $screen ) {
if ( 'tribe_events_page_tribe-common' !== $screen->base ) {
return;
}
if ( ! isset( $_GET['tab'] ) || 'addons' !== $_GET['tab'] ) {
return;
}
if (
! (
isset( $_GET['action'] )
&& isset( $_GET['_wpnonce'] )
&& 'disconnect-eventbrite' === $_GET['action']
&& wp_verify_nonce( $_GET['_wpnonce'], 'disconnect-eventbrite' )
)
) {
return;
}
$this->clear_eb_credentials();
wp_redirect(
Tribe__Settings::instance()->get_url( array( 'tab' => 'addons' ) )
);
die;
}