Skip to content

Commit

Permalink
Use redirect for links to WordPress.com
Browse files Browse the repository at this point in the history
We'll do it for other links as well in #23376.
  • Loading branch information
jeherve committed Mar 11, 2022
1 parent 923baf1 commit 7f959ff
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions projects/plugins/jetpack/extensions/plugins/payments/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* External dependencies
*/
import { getRedirectUrl } from '@automattic/jetpack-components';
import { ExternalLink } from '@wordpress/components';
import { PluginPostPublishPanel } from '@wordpress/edit-post';
import { currencyDollar } from '@wordpress/icons';
Expand All @@ -13,7 +14,7 @@ import analytics from '../../../_inc/client/lib/analytics';
import useAutosaveAndRedirect from '../../shared/use-autosave-and-redirect/index';

const PaymentsPostPublish = () => {
const paymentInfoUrl = 'https://wordpress.com/payments-donations/';
const paymentInfoUrl = getRedirectUrl( 'wpcom-payments-donations' );
const { autosaveAndRedirect } = useAutosaveAndRedirect( paymentInfoUrl );
const trackClick = event => {
event.preventDefault();
Expand All @@ -35,11 +36,7 @@ const PaymentsPostPublish = () => {
) }
</p>
<p>
<ExternalLink
href="https://wordpress.com/payments-donations/"
target="_blank"
onClick={ trackClick }
>
<ExternalLink href={ paymentInfoUrl } target="_blank" onClick={ trackClick }>
{ __( 'Learn more about these blocks', 'jetpack' ) }
</ExternalLink>
</p>
Expand Down

0 comments on commit 7f959ff

Please sign in to comment.