WordPress/wp-includes/blocks
spacedmonkey b80a8763c7 Database: Move the if statement outside of the loop.
In the foreach loop of last results, move the if statement outside of the loop. There is no need to check every element in the array for the output type. Do this once outside of the loop. For large database queries with lots of rows returned, this should improve PHP performance. 

Props spacedmonkey, Cybr, johnbillion, costdev, joemcgill.
Fixes #56541.
Built from https://develop.svn.wordpress.org/trunk@56066


git-svn-id: http://core.svn.wordpress.org/trunk@55578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 14:35:29 +00:00
..
archives Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
audio Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
avatar Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
block Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
button Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
buttons Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
calendar Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
categories Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
code Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
column Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
columns Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-author-name Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-content Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-date Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-edit-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-reply-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comment-template Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination-next Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination-numbers Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination-previous Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-title Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
cover Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
details Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
embed Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
file Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
footnotes Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
freeform Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
gallery Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
group Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
heading Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
home-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
html Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
image Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
latest-comments Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
latest-posts Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
legacy-widget Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
list Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
list-item Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
loginout Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
media-text Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
missing Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
more Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
navigation Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
navigation-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
navigation-submenu Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
nextpage Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
page-list Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
page-list-item Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
paragraph Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
pattern Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-author Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-author-biography Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-author-name Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-comments-form Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-content Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-date Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-excerpt Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-featured-image Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-navigation-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-template Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-terms Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-title Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
preformatted Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
pullquote Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-no-results Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination-next Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination-numbers Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination-previous Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-title Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
quote Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
read-more Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
rss Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
search Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
separator Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
shortcode Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
site-logo Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
site-tagline Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
site-title Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
social-link Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
social-links Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
spacer Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
table Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
tag-cloud Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
template-part Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
term-description Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
text-columns Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
verse Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
video Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
widget-group Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
archives.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
avatar.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
block.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
blocks-json.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
calendar.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
categories.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-author-name.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-content.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-date.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-edit-link.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-reply-link.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comment-template.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination-next.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination-numbers.php Editor: Update WordPress packages based based on Gutenberg v13.0 RC3 2022-04-12 15:12:47 +00:00
comments-pagination-previous.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
comments-pagination.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
comments-title.php Editor: Sync changes from the Gutenberg plugin 14.1 release 2022-09-20 15:43:29 +00:00
comments.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
cover.php Database: Move the if statement outside of the loop. 2023-06-27 14:35:29 +00:00
file.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
footnotes.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
gallery.php Block Editor: Updates the WordPress packages with all the fixes targetted for WP 6.2 beta1. 2023-02-07 13:00:09 +00:00
heading.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
home-link.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
image.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
index.php Script Loader: Fix performance issues in wp_common_block_scripts_and_styles. 2023-06-27 11:28:28 +00:00
latest-comments.php Editor: Update WordPress packages based based on Gutenberg v13.0 RC3 2022-04-12 15:12:47 +00:00
latest-posts.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
legacy-widget.php Editor: Update packages for 6.1 Release Candidate 2. 2022-10-18 13:56:02 +00:00
loginout.php Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1. 2021-11-08 14:29:21 +00:00
navigation-link.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
navigation-submenu.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
navigation.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
page-list-item.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
page-list.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
pattern.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-author-biography.php Editor: Update WordPress packages based based on Gutenberg v13.0 RC3 2022-04-12 15:12:47 +00:00
post-author-name.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
post-author.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-comments-form.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
post-content.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
post-date.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-excerpt.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-featured-image.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-navigation-link.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
post-template.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-terms.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
post-title.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-no-results.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
query-pagination-next.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination-numbers.php Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1. 2021-11-08 14:29:21 +00:00
query-pagination-previous.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query-pagination.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
query-title.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
query.php Editor: Update WordPress packages published for Gutenberg 10.6 2021-05-19 15:09:27 +00:00
read-more.php Block Editor: Updates the WordPress packages with all the fixes targetted for WP 6.2 beta1. 2023-02-07 13:00:09 +00:00
require-dynamic-blocks.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
require-static-blocks.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
rss.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
search.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
shortcode.php Editor: update JavaScript packages 2020-06-26 13:33:47 +00:00
site-logo.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
site-tagline.php Block Editor: Package updates for Beta 3. 2021-06-22 10:00:50 +00:00
site-title.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
social-link.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
tag-cloud.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
template-part.php Editor: update Wordpress npm packages. 2023-06-27 14:24:19 +00:00
term-description.php Block Editor: Updated the WordPress packages to include Gutenberg 15.1.0 changes. 2023-02-07 07:04:52 +00:00
widget-group.php Editor: Update packages for 6.1 Release Candidate 2. 2022-10-18 13:56:02 +00:00