Skip to content

Commit

Permalink
update: remove filter for authorize url
Browse files Browse the repository at this point in the history
  • Loading branch information
nirbhayel committed Nov 11, 2024
1 parent fc0f885 commit e01148b
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions modules/connect/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,9 @@ public static function is_connected() : bool {
return ! ! Data::get_access_token() && Utils::is_valid_home_url();
}

public function authorize_url( $authorize_url ) {
$utm_params = [];

$sm_campaign = get_transient( 'elementor_site_mailer_campaign' );
if ( false === $sm_campaign ) {
return $authorize_url;
}

foreach ( [ 'source', 'medium', 'campaign' ] as $key ) {
if ( ! empty( $sm_campaign[ $key ] ) ) {
$utm_params[ 'utm_' . $key ] = $sm_campaign[ $key ];
}
}

if ( ! empty( $utm_params ) ) {
$authorize_url = add_query_arg( $utm_params, $authorize_url );
}

return $authorize_url;
}

public function __construct() {
$this->register_components();
$this->register_routes();
add_filter( 'ea11y_connect_authorize_url', [ $this, 'authorize_url' ] );
}
}

0 comments on commit e01148b

Please sign in to comment.