-
Notifications
You must be signed in to change notification settings - Fork 810
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
Adding support for up to 6 related posts #11220
Conversation
D23611-code. (newly created revision) |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 5, 2019. |
Is this generated via some sort of a linting process or something? I see a lot of spaces being used instead of tabs. :\ |
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 would say we have gone through every bit of code here and I have no objections myself.
roccotripaldi, Your synced wpcom patch D23611-code has been updated. |
<?php | ||
$html = ob_get_clean(); | ||
|
||
remove_filter( 'the_content', 'wpautop' ); |
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 am unsure about the consequences of this change.
Could we achieve the same result by hiding <p>
s via css.
or as @enejb suggested maybe replacing new lines from $html
after $html = ob_get_clean();
?
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 can modify this a bit — or simply remove it in anticipation for https://core.trac.wordpress.org/ticket/45495 being closed in 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.
Could you provide a bit of background on this change? Is this already an issue with the current version of the Related Posts block? If yes, how can I reproduce the problem? If not, what changed?
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.
Internal discussion: pafL3P-jr-p2
roccotripaldi, Your synced wpcom patch D23611-code has been updated. |
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 will need a rebase first, though, to incorporate the recent changes to block registration (notably #11310). |
@jeherve It seems like videos are an exception here. But it may be a good idea to create a separate issue ticket to solve that. One other issue that I see is that images that have not been processed correctly on wordpress.com due to the connection being bad (example: https://i0.wp.com/alda8c.pagekite.me/wp-content/uploads/2019/02/vector__527___fluttershy__28_by_dashiesparkle-daashsq.png?resize=350%2C200&ssl=1) are also squares. I'm going to rebase this one to master and merge if all goes well. |
Extra p and br tags are being added to server-side generated blocks. This seems to be related to the do_blocks function in wp-includes/blocks.php adding and removing filters too early. Related: WordPress/gutenberg#13345, https://core.trac.wordpress.org/ticket/45495 and more
1b08c27
to
06ee6d8
Compare
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.
Approving once again, post rebase.
@@ -769,7 +769,7 @@ public function get_for_post_id( $post_id, array $args ) { | |||
$options['size'] = $args['size']; | |||
} | |||
|
|||
if ( ! $options['enabled'] || 0 == (int)$post_id || empty( $options['size'] ) || get_post_status( $post_id) !== 'publish' ) { |
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.
@aldavigdis Could you tell me more about removing the enabled
check? This is causing a regression in that we have a filter so folks can selectively disable RPs.
The published check was added in #9495 as a way to fix #9494 for a 400 HTTP request in the Block Editor for a published post.
See #11560
See #11546
Fixes 3718-gh-jpop-issues The curly quotes were added in #11220, but are not handled well by GlotPress. We need to revert to using regular double quotes.
Fixes 3718-gh-jpop-issues The curly quotes were added in #11220, but are not handled well by GlotPress. We need to revert to using regular double quotes.
Works with Automattic/wp-calypso#30224 to allow up to six related posts items.
Fixes #11014
Changes proposed in this Pull Request:
Testing instructions:
Run this on both a site that has less than 10 posts as well as a site that has more than 10 posts.
Proposed changelog entry for your changes: