Skip to content

Cover: Replace strpos() with str_contains() for improved readability#75907

Merged
Soean merged 1 commit intotrunkfrom
str_contains_refactor
Feb 25, 2026
Merged

Cover: Replace strpos() with str_contains() for improved readability#75907
Soean merged 1 commit intotrunkfrom
str_contains_refactor

Conversation

@Soean
Copy link
Copy Markdown
Member

@Soean Soean commented Feb 25, 2026

What?

This pull request makes a minor improvement to the render_block_core_cover function. The change is a code modernization: it replaces the use of the older strpos function with the newer and more readable str_contains function for detecting video providers in iframe sources.

We did the same in #43382
This code was introduced in #73023

@Soean Soean added [Type] Code Quality Issues or PRs that relate to code quality [Block] Cover Affects the Cover Block - used to display content laid over a background image labels Feb 25, 2026
@github-actions github-actions bot added [Package] Block library /packages/block-library First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Feb 25, 2026
@github-actions
Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Soean! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@Mamaduka Mamaduka removed the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Feb 25, 2026
Copy link
Copy Markdown
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @Soean!

@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Soean <soean@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Soean Soean enabled auto-merge (squash) February 25, 2026 12:34
@Soean Soean merged commit e8b19f6 into trunk Feb 25, 2026
48 of 49 checks passed
@Soean Soean deleted the str_contains_refactor branch February 25, 2026 13:02
@github-actions github-actions bot added this to the Gutenberg 22.7 milestone Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Cover Affects the Cover Block - used to display content laid over a background image [Package] Block library /packages/block-library [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants