Skip to content

Commit

Permalink
If the modal has no content then redirect to the permalink for the pe…
Browse files Browse the repository at this point in the history
…rson (#902)

Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham committed Nov 28, 2024
1 parent 1da53b9 commit 16f1a84
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
$modal_code += $modal_content.html();
$modal_code += '</div>';
$modal_content.empty();
} else if ( $modal_slug !== '' ) {
// if no modal content but slug is defined, redirect the page to the permalink for this person.
var urlWithoutQueryString = window.location.origin + window.location.pathname;
window.location.href = urlWithoutQueryString + '?p=' + $modal_slug;
return;
}
$modal_code += '</div></div></' + $modal_tag + '>';

Expand Down

0 comments on commit 16f1a84

Please sign in to comment.