Skip to content

Commit 1fe2cdf

Browse files
authored
Prevent PostDate as link to load inside an iframe (#31350)
1 parent be1c235 commit 1fe2cdf

File tree

1 file changed

+8
-1
lines changed
  • packages/block-library/src/post-date

1 file changed

+8
-1
lines changed

packages/block-library/src/post-date/edit.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ export default function PostDateEdit( { attributes, context, setAttributes } ) {
8080
__( 'No Date' )
8181
);
8282
if ( isLink && date ) {
83-
postDate = <a href="#post-date-pseudo-link">{ postDate }</a>;
83+
postDate = (
84+
<a
85+
href="#post-date-pseudo-link"
86+
onClick={ ( event ) => event.preventDefault() }
87+
>
88+
{ postDate }
89+
</a>
90+
);
8491
}
8592
return (
8693
<>

0 commit comments

Comments
 (0)