Update composer packages; Bump PHP to 7.4 and WP to 5.3#7613
Update composer packages; Bump PHP to 7.4 and WP to 5.3#7613westonruter merged 42 commits intodevelopfrom
Conversation
5499f6f to
65c5e6f
Compare
7e30db2 to
49e829c
Compare
3e4498e to
06d5930
Compare
|
|
||
| $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.
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.
This post is overriding the $post created just before. Should the above $post creation be put in an else?
|
|
||
| 'wp_editor_has_scripts_attributed' => [ | ||
| function () { | ||
| if ( version_compare( get_bloginfo( 'version' ), '5.2', '<=' ) ) { |
There was a problem hiding this comment.
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
| $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.
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.
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.
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.
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
Summary
Checklist