When files are copied into place, check whether opcode invalidation is available and attempt to invalidate to avoid unintended behavior or fatal errors from themes, plugins, or core.
Introduces `wp_opcache_invalidate()` to allow safe invalidation of PHP files from opcode cache, and a filter, `wp_opcache_invalidate_file` to override the behavior.
Replaces the existing calls to `opcache_invalidate()` in the plugin and theme editors to use the new function.
Thanks to jnylen0 for porting over a patch from ClassicPress that provided much of the approach for what is being committed.
Props nigro.simone, dd32, JasWSInc, szepe.viktor, swissspidy, JanR, asalce, Garavani, pavelevap, pputzer, GregLone, benoitchantre, jadonn, doc987, kraftbj, Krstarica, jnylen0, nextendweb, williampatton, ayeshrajans, joostdevalk, stevenkussmaul, boogah, jorbin, mikeschroder.
Fixes#36455, #50354.
Built from https://develop.svn.wordpress.org/trunk@48160
git-svn-id: http://core.svn.wordpress.org/trunk@47929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp_update_comment_data` filter introduced in 4.7 allows comment data to be filtered before it is updated in the database.
The patch aims to handle `WP_Error` as the filter above return value in a similar manner as is done for `wp_new_comment()`.
Fixes#39732.
Props: enricosorcinelli, swissspidy, gkloveweb, jnylen0, jbpaul17, afercia, SergeyBiryukov, audrasjb, imath, davidbaumwald.
Built from https://develop.svn.wordpress.org/trunk@48154
git-svn-id: http://core.svn.wordpress.org/trunk@47923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes the API a little more clear, whereas setting `false` used to mean `asc` and `true` meant `desc`, you can now use those directly, while maintaining back-compat.
Fixes#45089.
Props Tkama, SergeyBiryukov, shital-patel, desrosj, birgire, davidbaumwald.
Built from https://develop.svn.wordpress.org/trunk@48151
git-svn-id: http://core.svn.wordpress.org/trunk@47920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This ensures that the link still makes sense when read out of context by assistive technologies.
Additionally, underline the link per the accessibility coding standards.
Props samful, afercia, williampatton, audrasjb.
Fixes#50338.
Built from https://develop.svn.wordpress.org/trunk@48146
git-svn-id: http://core.svn.wordpress.org/trunk@47915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Per WCAG 2.0 guidelines, big chunks of italic text should be avoided for better accessibility.
Additionally, replace the legacy `.error` class for "You deactivated this plugin and may no longer need this policy" message with `.notice-info`.
Follow-up to [47147], [48116].
Props afercia, audrasjb.
See #47327, #44621.
Built from https://develop.svn.wordpress.org/trunk@48145
git-svn-id: http://core.svn.wordpress.org/trunk@47914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The new names make the purpose more clear. It also adds consistency with the `$allowed_options` global variable.
Also in this change, the `wp-deprecated` dependency has been removed from the password strength meter in favor of a `window.console.log()` call to avoid adding 3 dependencies for one deprecated notice.
Props SergeyBiryukov, ocean90, desrosj
Fixes#50413.
Built from https://develop.svn.wordpress.org/trunk@48142
git-svn-id: http://core.svn.wordpress.org/trunk@47911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `gettext_{$domain}`
* `gettext_with_context_{$domain}`
* `ngettext_{$domain}`
* `ngettext_with_context_{$domain}`
Additionally:
* Pass `$domain` parameter to the new hooks, for consistency with their pre-existing counterparts.
* Update documentation to explain the dynamic portion of the filter, for consistency with other dynamic hooks in core.
Follow-up to [48131].
Props swissspidy, knutsp, TimothyBlynJacobs, SergeyBiryukov.
Fixes#49518.
Built from https://develop.svn.wordpress.org/trunk@48136
git-svn-id: http://core.svn.wordpress.org/trunk@47905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If a user selects the top option, then chooses a different option, the top selection takes precedence. This update gives a new name to the bottom action, ensuring the proper update is carried out.
Fixes 46872.
Props clayray, garrett-eclipse, subrataemfluence.
Built from https://develop.svn.wordpress.org/trunk@48134
git-svn-id: http://core.svn.wordpress.org/trunk@47903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adding context to allow for more specific targeting. New hooks:
* `gettext-{$domain}`
* `gettext_with_context-{$domain}`
* `ngettext-{$domain}`
* `ngettext_with_context-{$domain}`
Fixes#49518.
Props geminilabs, garrett-eclipse, davidbaumwald, johnbillion, whyisjake.
Built from https://develop.svn.wordpress.org/trunk@48131
git-svn-id: http://core.svn.wordpress.org/trunk@47900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Also, remove the `version` argument from the `wp.deprecated()` call in `password-strength-meter.js`. This argument is for specifying the version a feature will be removed, not when the feature was removed.
Props hareesh-pillai.
Fixes#50413.
Built from https://develop.svn.wordpress.org/trunk@48124
git-svn-id: http://core.svn.wordpress.org/trunk@47893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes several improvements to the emails sent to site admins when plugin and theme auto-updates are attempted.
- Emails are now specifically tailored to the three results (success, failed, or mixed).
- Subject lines and body copy for mixed and failed results now correctly convey the importance of double checking the site in question.
- The site’s URL is now included in all emails.
- When failures occur, links to the Plugins and/or Themes pages in the admin are now included so that site owners can easily take action.
Props audrasjb, desrosj, azaozz, garrett-eclipse, paaljoachim, johnbillion, marybaum, pbiron.
Follow up to [47835].
See #50052.
Fixes#50268.
Built from https://develop.svn.wordpress.org/trunk@48123
git-svn-id: http://core.svn.wordpress.org/trunk@47892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
“The WordPress open source community cares about diversity. We strive to maintain a welcoming environment where everyone can feel included.”
With this commit, all occurrences of “whitelist” and “blacklist” (with the single exception of the `$new_whitelist_options` global variable) are removed. A new ticket has been opened to explore renaming the `$new_whitelist_options` variable (#50434).
Changing to more specific names or rewording sentences containing these terms not only makes the code more inclusive, but also helps provide clarity. These terms are often ambiguous. What is being blocked or allowed is not always immediately clear. This can make it more difficult for non-native English speakers to read through the codebase.
Words matter. If one contributor feels more welcome because these terms are removed, this was worth the effort.
Props strangerstudios, jorbin, desrosj, joemcgill, timothyblynjacobs, ocean90, ayeshrajans, davidbaumwald, earnjam.
See #48900, #50434.
Fixes#50413.
Built from https://develop.svn.wordpress.org/trunk@48121
git-svn-id: http://core.svn.wordpress.org/trunk@47890 1a063a9b-81f0-0310-95a4-ce76da25c4cd