Skip to content

Commit

Permalink
Add comments to explain external=true param
Browse files Browse the repository at this point in the history
  • Loading branch information
Imran92 committed Mar 28, 2024
1 parent a9afd97 commit fc5fa71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/home/tasks-section/task-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { Icon, external } from '@wordpress/icons';
const TaskItem = ( { title, url, done } ) => {
const Tag = done ? 'span' : 'a';
const isExternal =
isUrlExternal( url ) || url?.indexOf( 'external=true' ) >= 0;
isUrlExternal( url ) || url?.indexOf( 'external=true' ) >= 0; // If the URL contains 'external=true', we show the external icon,
// It's helpful when it's an internal URL (maybe for tracking purpose) but redirecting to an external one.

const linkProps = ! done && {
href: url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function get_title(): string {
* @return string
*/
public function get_url(): ?string {
// Here external=true is used to show the external link icon in the frontend component.
return rest_url( 'sensei-internal/v1/home/sensei-pro-upsell-redirect?_wpnonce=' . wp_create_nonce( 'wp_rest' ) . '&external=true' );
}

Expand Down

0 comments on commit fc5fa71

Please sign in to comment.