Automattic\WooCommerce\Internal\Admin
Marketplace::maybe_open_woo_tab
Open the Woo tab when the user clicks on the Woo link in the plugin installer.
Method of the class: Marketplace{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Marketplace = new Marketplace(); $Marketplace->maybe_open_woo_tab();
Marketplace::maybe_open_woo_tab() Marketplace::maybe open woo tab code WC 10.7.0
public function maybe_open_woo_tab() {
// phpcs:disable WordPress.Security.NonceVerification.Recommended
if ( ! isset( $_GET['tab'] ) || self::MARKETPLACE_TAB_SLUG !== $_GET['tab'] ) {
return;
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
$woo_url = add_query_arg(
array(
'page' => 'wc-admin',
'path' => '/extensions',
'tab' => 'extensions',
'ref' => 'plugins',
),
admin_url( 'admin.php' )
);
wc_admin_record_tracks_event( 'marketplace_plugin_install_woo_clicked' );
wp_safe_redirect( $woo_url );
exit;
}