-
Notifications
You must be signed in to change notification settings - Fork 385
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
Update composer packages; Bump PHP to 7.4 and WP to 5.3 #7613
Conversation
5499f6f
to
65c5e6f
Compare
7e30db2
to
49e829c
Compare
3e4498e
to
06d5930
Compare
@@ -425,9 +426,21 @@ public function test_get_taxonomy_links() { | |||
); | |||
} | |||
|
|||
$post = self::factory()->post->create(); | |||
|
|||
// `wp_pattern_category` is a special taxonomy that is registered for categorizing patterns. |
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.
Added in recent GB release - WordPress/gutenberg#53163
Plugin builds for 3eb015a are ready 🛎️!
|
// `wp_pattern_category` is a special taxonomy that is registered for categorizing patterns. | ||
// It is only associated with the `wp_block` post type, so we need to create a `wp_block` post. | ||
if ( 'wp_pattern_category' === $taxonomy ) { | ||
$post = self::factory()->post->create( |
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 post is overriding the $post
created just before. Should the above $post
creation be put in an else
?
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.
Done in 9b700ff
@@ -1215,8 +1212,10 @@ function ( $sources ) { | |||
|
|||
'wp_editor_has_scripts_attributed' => [ | |||
function () { | |||
if ( version_compare( get_bloginfo( 'version' ), '5.2', '<=' ) ) { |
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.
Strange that 5.2 was the version here when 5.5 is the version it was introduced in.
Co-authored-by: Weston Ruter <westonruter@google.com>
efbdb82
to
056f613
Compare
@@ -307,7 +310,7 @@ private function get_posts_by_type( $post_type, $offset = null ) { | |||
} | |||
$query = new WP_Query( $args ); | |||
|
|||
return $this->get_posts_that_support_amp( $query->posts ); | |||
return $this->get_posts_that_support_amp( $query->posts, $posts_to_exclude ); |
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.
Instead of updating the get_posts_that_support_amp
method with this new parameter, it would seem better to me to just do the filtering here in this method:
return $this->get_posts_that_support_amp( $query->posts, $posts_to_exclude ); | |
$posts = array_values( | |
array_filter( | |
$query->posts, | |
static function ( $post ) use ( $posts_to_exclude ) { | |
return ! in_array( $post->ID, $posts_to_exclude, true ); | |
} | |
) | |
); | |
return $this->get_posts_that_support_amp( $posts ); |
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.
Hold on, this can be simplified further since we're getting IDs:
return $this->get_posts_that_support_amp( $query->posts, $posts_to_exclude ); | |
return $this->get_posts_that_support_amp( array_diff( $query->posts, $posts_to_exclude ) ); |
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 thought since we already filter these post IDs and array_diff
is considered slow, completing the task in a single run would be performant. However, any performance impact should be negligible here as the array size will be 100 only.
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.
So we can go with array_diff()
instead? It's less code and doens't change the resulting API.
I just had a concerning thought that this would cause problems for Web Stories. But I see that it already requires PHP 7.4. So we're all good there. |
5659947
to
3eb015a
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.
Awesome!
Summary
Checklist