In WordPress 6.3, the last parameter of `wp_register_script()` and `wp_enqueue_script()` was changed to an array rather than a boolean. While a boolean is still supported for backward compatibility, it makes sense to update the codebase to use the new signature.
The updates are fully backward compatible:
* In places where `true` was provided, `array( 'in_footer' => true )` will still be interpreted as a boolean true in WordPress versions prior to 6.3.
* In places where `false` was provided, the parameter is omitted which will work correctly throughout all WordPress versions given that is and has been the default value anyway.
Props mrinal013, huzaifaalmesbah, niravsherasiya7707, joemcgill.
Fixes#59302.
See #58634.
Built from https://develop.svn.wordpress.org/trunk@56526
git-svn-id: http://core.svn.wordpress.org/trunk@56038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is a micro-optimization that removes a few unnecessary function calls.
Follow-up to [31188], [34369], [38986], [41159], [43211], [43230], [44606], [45757].
Props ayeshrajans, jrf, rajinsharwar, costdev, mukesh27, SergeyBiryukov.
Fixes#58943.
Built from https://develop.svn.wordpress.org/trunk@56352
git-svn-id: http://core.svn.wordpress.org/trunk@55864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since both functions return the exact same thing, this changeset makes `twentyseventeen_is_static_front_page()` an alias of `twentyseventeen_is_frontpage()`
and updates the related docblocks and function callback.
Props mukesh27, soulseekah, swissspidy, sabernhardt, audrasjb, SergeyBiryukov, hareesh-pillai.
Fixes#43515.
Built from https://develop.svn.wordpress.org/trunk@56012
git-svn-id: http://core.svn.wordpress.org/trunk@55524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [52039], [52040], [52326], [55703], [55710], [55987].
Props Soean, spacedmonkey, costdev, dingo_d, azaozz, mikeschroder, flixos90, peterwilsoncc, SergeyBiryukov.
Fixes#58206.
Built from https://develop.svn.wordpress.org/trunk@55988
git-svn-id: http://core.svn.wordpress.org/trunk@55500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.
Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes#29748.
Built from https://develop.svn.wordpress.org/trunk@55276
git-svn-id: http://core.svn.wordpress.org/trunk@54809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:
- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes
Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes#39733.
Built from https://develop.svn.wordpress.org/trunk@52929
git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Upon further examination, this change was not great for backwards compatibility, resulting in block validation errors when running on older versions of WordPress.
While there are currently many `console.info()` notices caused by older format block syntax being updated to the current version included in WordPress 5.8, the blocks do not break.
Block patterns do not currently have a versioning mechanism, or a means to indicate which versions of WordPress are supported.
See #53617.
Built from https://develop.svn.wordpress.org/trunk@51434
git-svn-id: http://core.svn.wordpress.org/trunk@51045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using the post editor with a bundled theme active, there will be a number of `console.info` notices printed to the browser’s console.
These notices are caused by block patterns containing outdated and deprecated versions of `core/*` blocks. Before rendering the blocks, they need to be updated, and this process outputs information to the console.
Props ntsekouras.
Fixes#53617.
Built from https://develop.svn.wordpress.org/trunk@51372
git-svn-id: http://core.svn.wordpress.org/trunk@50983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.
This commit also includes:
* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
* `wp-admin/admin-header.php`
* `wp-admin/admin-footer.php`
* `wp-includes/version.php`
Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes#48082.
Built from https://develop.svn.wordpress.org/trunk@47198
git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress 5.2 adds the `wp_body_open()` function, and the default themes make use of it. This patch adds a shim for `wp_body_open` to bundled themes so this function will also work in older versions of WordPress.
Props lgedeon, johnbillion, timph, ramiy, pento.
Fixes#46679.
Built from https://develop.svn.wordpress.org/trunk@45256
git-svn-id: http://core.svn.wordpress.org/trunk@45065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.
This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script.
- Auto-fixable coding standards issues will now cause Travis failures.
Fixes#44600.
Built from https://develop.svn.wordpress.org/trunk@43571
git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The category is not shown in the preview. And because of how `themename_categorized_blog()` function in each theme returns false for 1 or fewer categories, and in this case it won't show the new category.
The patch uses `is_preview()` to fix that in Twenty Fourteen, Fifteen and Seventeen.
Props lancewillett.
Fixes#39531.
Built from https://develop.svn.wordpress.org/trunk@40023
git-svn-id: http://core.svn.wordpress.org/trunk@39960 1a063a9b-81f0-0310-95a4-ce76da25c4cd