Skip to content

Commit

Permalink
Prevent PostDate as link to load inside an iframe (#31350)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored Apr 30, 2021
1 parent be1c235 commit 1fe2cdf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/block-library/src/post-date/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,14 @@ export default function PostDateEdit( { attributes, context, setAttributes } ) {
__( 'No Date' )
);
if ( isLink && date ) {
postDate = <a href="#post-date-pseudo-link">{ postDate }</a>;
postDate = (
<a
href="#post-date-pseudo-link"
onClick={ ( event ) => event.preventDefault() }
>
{ postDate }
</a>
);
}
return (
<>
Expand Down

0 comments on commit 1fe2cdf

Please sign in to comment.