-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Gutenberg Backport: Use static closures whenever $this is not used to avoid memory leaks #4629
Conversation
$filter_title = function( $title, $original_title ) { | ||
$filter_title = static function( $title, $original_title ) { |
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.
Note: This code doesn't exist in Gutenberg. It instead has:
$filter_excerpt_more = function( $more ) use ( $more_text ) { | ||
$filter_excerpt_more = static function( $more ) use ( $more_text ) { |
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.
Note that WordPress/gutenberg#50723 had another static
addition in this file:
I guess it will come in another backport or the change in core wasn't "for-ported" to Gutenberg?
@westonruter All the updates to the blocks php are unneeded. When the blocks are synced as part of the release, this will happen automatically. |
…into trac-58323-2 * 'trunk' of https://github.com/WordPress/wordpress-develop: (106 commits) Twenty Nineteen: Ensure Separator block supports theme colors in editor. Tools: Fix unresolvable conflicts computation in package sync script. Twenty Twenty: Fix left margin in Latest Posts & Latest Comments blocks. Script Loader: Add support for HTML 5 "async" and "defer" attributes. Code Modernization: Use `str_contains()` in a few more places. Code Modernization: Use `str_contains()` in a few more places. Editor: rename reusable blocks to patterns. Editor: fix site editor layout bug. Editor: add support for block-level link hover colors. Upgrade/Install: Update 'show details' button change. Administration: Fix visual regression in media search input. Editor: Add no-js fallback for site editor. Upgrade/Install: Add aria-describedby for input descriptions. Administration: Consistent positioning and size of search form. Quick/Bulk Edit: Don't set publish date when editing drafts. Code Modernization: Use `str_contains()` in a few more places. Code Modernization: Use `str_starts_with()` and `str_ends_with()` in a few more places. Code Modernization: Use `str_starts_with()` and `str_ends_with()` in a few more places. Editor: Improve accessibility of new custom field UI. Coding Standards: Use Yoda condition in `str_ends_with()`. ...
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.
Thanks @westonruter, LGTM!
Committed in https://core.trac.wordpress.org/changeset/56038 |
This backports the changes from WordPress/gutenberg#50723
See WordPress/gutenberg#51077
Trac ticket: https://core.trac.wordpress.org/ticket/58323
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.