-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/issue 48/change single post inner blocks more blocks #54
Feature/issue 48/change single post inner blocks more blocks #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions 🐙
*/ | ||
registerBlockType( | ||
/* @ts-expect-error Provided types are inaccurate to the actual plugin API. */ | ||
metadata, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the issue here?
$wp_newsletter_builder_block_post = $block->context['postId'] ?? null; | ||
|
||
$wp_newsletter_builder_block_post = get_post( $wp_newsletter_builder_block_post ); | ||
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { | |
if ( empty( $wp_newsletter_builder_block_post ) ) { |
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { | ||
return; | ||
} | ||
$wp_newsletter_builder_excerpt = ! empty( $attributes['overrideExcerpt'] ) ? $attributes['overrideExcerpt'] : get_the_excerpt( $wp_newsletter_builder_block_post ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$wp_newsletter_builder_excerpt = ! empty( $attributes['overrideExcerpt'] ) ? $attributes['overrideExcerpt'] : get_the_excerpt( $wp_newsletter_builder_block_post ); | |
$wp_newsletter_builder_excerpt = $attributes['overrideExcerpt'] ?? get_the_excerpt($wp_newsletter_builder_block_post); |
$wp_newsletter_builder_block_post = $block->context['postId'] ?? null; | ||
|
||
$wp_newsletter_builder_block_post = get_post( $wp_newsletter_builder_block_post ); | ||
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { | |
if ( empty( $wp_newsletter_builder_block_post ) ) { |
if ( empty( $wp_newsletter_builder_block_post ) || ! $wp_newsletter_builder_block_post ) { | ||
return; | ||
} | ||
$wp_newsletter_builder_byline = ! empty( $attributes['overrideByline'] ) ? $attributes['overrideByline'] : get_byline( $wp_newsletter_builder_block_post ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$wp_newsletter_builder_byline = ! empty( $attributes['overrideByline'] ) ? $attributes['overrideByline'] : get_byline( $wp_newsletter_builder_block_post ); | |
$wp_newsletter_builder_byline = $attributes['overrideByline'] ?? get_byline($wp_newsletter_builder_block_post); |
Creates more custom blocks to use as InnerBlocks. See #50