-
Notifications
You must be signed in to change notification settings - Fork 805
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
Giphy Block Registration #10989
Giphy Block Registration #10989
Conversation
D22406-code. (newly created revision) |
This is automated check which relies on |
9179d10
to
d299d1d
Compare
e592f5e
to
e909277
Compare
…, inclusion of '%' in the saved attribute.
- Remove parens around echo - Add missing style quotes - Use double quotes consistently
I pushed a commit to clean up the HTML a bit. There were some missing as well as mixed single and double quotes. I removed the parens around the echo arguments, they're not necessary and they seem to be mostly omitted in this code base. |
modules/blocks.php
Outdated
<iframe src="<?php echo esc_attr( $giphy_url ); ?>" title="<?php echo esc_attr( $search_text ); ?>"></iframe> | ||
</figure> | ||
<?php if ( $caption ) : ?> | ||
<p class="wp-block-jetpack-giphy-caption"><?php echo wp_kses_post( $caption ); ?></p> |
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.
Highlighting for reviewers the use of wp_kses_post
here.
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.
This looks good and tests well. I have a lingering doubt but it can be addressed in a follow-up PR.
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.
I only have minor remarks about this PR (see below), but I do have some feedback about the block itself.
Should Giphy be capitalized in the block description?
For some reason the additional classes don't get added to the wrapper:
I was a bit surprised by the block icon; I would have expected it to be an image or a Giphy logo instead of this:
cc: @thomasguillot |
Sure thing. |
This "lingering doubt" is the placeholder state, correct? If so, it's addressed in: Automattic/wp-calypso#30402 and bd0a281 |
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.
I left one suggestion.
This reverts commit 94392ce.
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.
I think this is in a good place and the serialized block structure has likely reached some stability. I think this is ready to land any time.
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.
I like it. Let's ship it!
For anyone interested, I have open a ticket on core and on the gutenberg repo. WordPress/gutenberg#13426 |
Registers the Giphy block and handles Server-Side Rendering. SSR approach is being used because IFRAME element will be stripped out of post content on WP.com. Discussion of this here: p5TWut-gm-p2.
Companion
wp-calypso
PR: Automattic/wp-calypso#29638Changes proposed in this Pull Request:
Testing instructions:
JETPACK_BETA_BLOCKS
, and Save.Complete testing instructions found here: Automattic/wp-calypso#29638
Changelog