Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix author information leakage by author blocks for Custom Post Types without author support & display notice to user #67136

Merged
merged 7 commits into from
Dec 18, 2024
Prev Previous commit
Next Next commit
fix: PHP coding standards
  • Loading branch information
sarthaknagoshe2002 committed Nov 19, 2024
commit dc2e0671aef7e28c07641ce82605882c6f7ab644
2 changes: 1 addition & 1 deletion packages/block-library/src/post-author-name/index.php
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
}

if ( ! post_type_supports( get_post_type( $block->context['postId'] ), 'author' ) ) {
sarthaknagoshe2002 marked this conversation as resolved.
Show resolved Hide resolved
return '';
return '';
}

$author_name = get_the_author_meta( 'display_name', $author_id );
4 changes: 2 additions & 2 deletions packages/block-library/src/post-author/index.php
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ function render_block_core_post_author( $attributes, $content, $block ) {
}

if ( ! post_type_supports( get_post_type( $block->context['postId'] ), 'author' ) ) {
return '';
}
return '';
}

$avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar(
$author_id,
Loading