Several query vars only accept a scalar value and pass the value through functions that assume a scalar value. Adding extra guard conditions to the types of query vars doesn't affect their functionality but does remove PHP notices and warnings that can otherwise be generated when a non-scalar value such as an array is present in a query var.
Props juliobox, xknown, SergeyBiryukov, dave1010, nacin, tellyworth, dd32, audrasjb, johnregan3
Fixes#17737
Built from https://develop.svn.wordpress.org/trunk@53891
git-svn-id: http://core.svn.wordpress.org/trunk@53450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There were two sets of tests for `is_serialized()`:
* One in the `functions.php` file, based on the same file name in core.
* One in a separate class in the `functions` directory.
To avoid confusion and make it easier to decide where new tests should go in the future, the existing tests are now combined in the latter location.
Includes:
* Moving `is_serialized()` and `maybe_serialize()` tests into their own classes.
* Using named data providers to make test output more descriptive.
* Combining test cases and removing duplicates.
Follow-up to [278/tests], [279/tests], [328/tests], [32631], [45754], [47452], [49382], [53886], [53889].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53890
git-svn-id: http://core.svn.wordpress.org/trunk@53449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset introduces new `wp_required_field_indicator()` and `wp_required_field_message()` helper functions to generate reusable and consistent required field indicator and message. It also implements these functions in various admin screens.
Props sabernhardt, ryokuhi, joedolson, audrasjb, SergeyBiryukov.
Fixes#54394.
Built from https://develop.svn.wordpress.org/trunk@53888
git-svn-id: http://core.svn.wordpress.org/trunk@53447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This should help determine whether the current request is for the login screen.
While it does not save a lot of lines of code, including this function in core aims to save developers some time that would otherwise be spent investigating the most reliable way to solve this problem.
Implementation details:
* By checking `wp_login_url()`, the function accounts for custom login locations set via the `login_url` filter.
* By checking `$_SERVER['SCRIPT_NAME']` directly, instead of `did_action( 'login_form_login' )` or `$pagenow` global, the function can work as early as possible, for example in a must-use plugin.
Follow-up to [2481], [6412], [12393], [12732], [15558], [15481], [15746].
Props dcowgill, scribu, donmhico, iandunn, wonderboymusic, nacin, robmiller, kitchin, chriscct7, tazotodua, davidbaumwald, SergeyBiryukov.
Fixes#19898.
Built from https://develop.svn.wordpress.org/trunk@53884
git-svn-id: http://core.svn.wordpress.org/trunk@53443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the requirement that a Super Admin must be a member of the current site when they attempt to set an application password within the admin area of an individual site on the network.
Props TimothyBlynJacobs, ilovecats7, johnbillion, georgestephanis, johnjamesjacoby
Fixes#53224
Built from https://develop.svn.wordpress.org/trunk@53882
git-svn-id: http://core.svn.wordpress.org/trunk@53441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To help avoid issues with trailing whitespace, omitting the closing PHP tag at the end of a file is preferred.
Props netweb, dd32, yahil, milindmore22, vishalkakadiya, NomNom99, manishsongirkar36, sabernhardt, audrasjb, desrosj.
See #40039.
Built from https://develop.svn.wordpress.org/trunk@53880
git-svn-id: http://core.svn.wordpress.org/trunk@53439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, when using `switch_to_locale()` all current loaded text domains were unloaded and added to the `$l10n_unloaded` global. This prevented the just-in-time loading for text domains after a switch. The just-in-time loading was also only possible if the translations were stored in `WP_LANG_DIR`. Both issues have been fixed.
* Adds `WP_Textdomain_Registry` to keep track of the language directory paths for all plugins and themes.
* Updates all `load_*_textdomain()` functions to store the path in `WP_Textdomain_Registry`.
* Adds `$locale` parameter to `load_textdomain()` to specify the locale the translation file is for.
* Adds `$reloadable` parameter to `unload_textdomain()` to define whether a text domain can be loaded just-in-time again. This is used by `WP_Locale_Switcher::load_translations()`.
* Extends `_load_textdomain_just_in_time()` to also support text domains of plugins and themes with custom language directories.
* Fixes the incorrect `test_plugin_translation_after_switching_locale_twice()` test which should have caught this issue earlier.
* Adds a new test plugin and theme to test the loading of translations with a custom language directory.
* Deprecates the now unused and private `_get_path_to_translation()` and `_get_path_to_translation_from_lang_dir()` functions.
Previously added in [49236] and reverted in [49236] to investigate concerns which are now addressed here.
Props yoavf, swissspidy, dd32, ocean90.
See #26511.
Fixes#39210.
Built from https://develop.svn.wordpress.org/trunk@53874
git-svn-id: http://core.svn.wordpress.org/trunk@53433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset adds an `is_string( $taxonomy )` check to the condition in `taxonomy_exists()`, to ensure `false` is returned when the `$taxonomy` is not a string.
Follow-up to [35718].
Props costdev, peterwilsoncc, mukesh27.
Fixes#56338.
See #56336.
Built from https://develop.svn.wordpress.org/trunk@53869
git-svn-id: http://core.svn.wordpress.org/trunk@53428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Improve the performance of `WP_List_Table::get_column_info()` by adding the primary column to the cached header values. This reduces the number of calls to the `WP_List_Table::get_primary_column_name()` method to once per table in line with the other header getter functions.
Props bobbingwide, chaion07, costdev, mikeschroder, mukesh27, peterwilsoncc, shetheliving, spacedmonkey.
Fixes#34564.
Built from https://develop.svn.wordpress.org/trunk@53868
git-svn-id: http://core.svn.wordpress.org/trunk@53427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `WP_Filesystem_FTPext::exists()`
* `WP_Filesystem_FTPext::size()`
* `WP_Filesystem_ftpsockets::exists()`
The `::exists()` methods were previously using the FTP `NLST` command, which works for directories, but is not intended to be applied to a file. This only worked most of the time due to many FTP servers being permissive and allowing to execute `NLST` on files, which cannot be guaranteed and appears to not be the case in newer versions of Pure-FTPd (1.0.48 or later).
With a recent change in [53860], both methods were updated for compatibility with RFC 959:
* Both methods check if the path is a directory that can be changed into (and therefore exists).
* `WP_Filesystem_FTPext` uses `ftp_rawlist()` (FTP `LIST` command) to check for file existence.
* `WP_Filesystem_ftpsockets` uses file size to check for file existence.
Reference: [https://www.ietf.org/rfc/rfc959.txt RFC 959: File Transfer Protocol (FTP)]
Follow-up to [6779], [11821], [25274], [33648], [34733], [35944], [35946], [53860].
See #51170.
Built from https://develop.svn.wordpress.org/trunk@53862
git-svn-id: http://core.svn.wordpress.org/trunk@53421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Make it specifically about `wp_resolve_numeric_slug_conflicts()`, the function that was throwing an `Undefined array key "year"` PHP warning for malformed date requests.
* Move the test under the `rewrite` component and make its name a bit more descriptive.
* Check the return result of the function instead of performing a dummy assertion.
* Use named array keys in the data provider for clarity.
* Add missing `@covers` tag.
Follow-up to [32648], [53857].
Props costdev, peterwilsoncc, 1naveengiri, mukesh27, SergeyBiryukov.
See #52252, #45513.
Built from https://develop.svn.wordpress.org/trunk@53861
git-svn-id: http://core.svn.wordpress.org/trunk@53420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress FTP file checking was previously based upon `ftp_nlist()`. This function can be problematic at scale with a directory containing a large number of files. The same issue occurred using it with ftpsockets.
This changeset rewrites the FTP `exists()` functions to utilize a more efficient and stable check.
Props giox069, desrosj, mkox, afragen, costdev, pbiron, peterwilsoncc.
Fixes#51170.
See #53318, #39781.
Built from https://develop.svn.wordpress.org/trunk@53860
git-svn-id: http://core.svn.wordpress.org/trunk@53419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures `has_blocks()` doesn't return a fatal error when `$post` is not a valid post. If the post can't be retrieved, the function now returns `false`.
Props Howdy_McGee, costdev, colonelphantom, audrasjb, dlh, peterwilsoncc.
Fixes#55705.
Built from https://develop.svn.wordpress.org/trunk@53858
git-svn-id: http://core.svn.wordpress.org/trunk@53417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that date queries contain each component before attempting to use them. This prevents http requests triggering notices if a portion of the date is missing. For example a request containing a day and year but no month, a request containing a month bu not year.
Props ovidiul, dd32, peterwilsoncc, costdev, johnbillion, SergeyBiryukov, desrosj, tremidkhar, hellofromTonya.
Fixes#52252.
Built from https://develop.svn.wordpress.org/trunk@53857
git-svn-id: http://core.svn.wordpress.org/trunk@53416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows for arbitrary properties to be declared on it.
Alternatively, the `MockClass` could be deprecated altogether in favor of directly using `stdClass` where needed.
Follow-up to [53/tests], [65/tests], [53557], [53558], [53850], [53851], [53852], [53853], [53854].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53856
git-svn-id: http://core.svn.wordpress.org/trunk@53415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
In this case, as the `$badchars` property never changes, declaring this as a class constant is the sensible option.
As for the `$dir` property (which cannot be turned into a constant due to the function call), this is used in multiple tests, so making this property explicit makes sense.
Follow-up to [139/tests], [53557], [53558], [53850], [53851], [53852], [53853].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53854
git-svn-id: http://core.svn.wordpress.org/trunk@53413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
In this particular case, the test class contains a `set_up()` method that sets the `$post_type` property, which is ''used'' by the tests, but never ''changed'' by the tests.
In other words, setting this property in the `set_up()` is an unnecessary overhead and the property should be changed to a class constant.
Follow-up to [1212/tests], [52389], [53557], [53558], [53850], [53851], [53852].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53853
git-svn-id: http://core.svn.wordpress.org/trunk@53412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
In this particular case, the test class contains a `set_up()` method that sets the `$img_meta` property, which is ''used'' by the tests, but never ''changed'' by the tests.
In other words, setting this property in the `set_up()` is an unnecessary overhead and the property should be changed to a class constant.
Includes renaming the test class to match the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions].
Follow-up to [52190], [53557], [53558], [53850], [53851].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53852
git-svn-id: http://core.svn.wordpress.org/trunk@53411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The dynamically created `$undefined` property appears to be a copy/paste from the `Tests_WP_Customize_Setting` class, and is not actually used in other test classes:
* `Tests_WP_Customize_Manager`
* `Tests_WP_Customize_Panel`
* `Tests_WP_Customize_Section`
Follow-up to [31329], [32658].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53851
git-svn-id: http://core.svn.wordpress.org/trunk@53410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In this particular case, the test class contains a `set_up()` method which sets properties only used by select tests, while the fixture method is being run for all tests.
There were a few ways this could be fixed:
* As the values do not change across tests, use `set_up_before_class()` to set (static) properties instead.
* For those values which are set up without a function call or variable interpolation, set the values in class constants.
* Or set these values as local variables for those tests which actually use them.
The implemented solution is a combination of options 2 and 3.
Follow-up to [1106/tests], [53557], [53558].
Props jrf.
See #56033.
Built from https://develop.svn.wordpress.org/trunk@53850
git-svn-id: http://core.svn.wordpress.org/trunk@53409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Correct an issue where the secondary mime type full size image would not be properly resized (and `-scaled` added to the name) when the original upload is over the `big_image_size_threshold` dimensions.
Props mukesh27.
See #55443.
Built from https://develop.svn.wordpress.org/trunk@53848
git-svn-id: http://core.svn.wordpress.org/trunk@53407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add a `wp_preload_resources` filter that developers can use to add resource preloading.
Preloading helps the browser discover and prioritize important resources earlier during the page load. This ensures that they are available earlier and are less likely to block the page's render.
Props nico23, swissspidy, igrigorik, westonruter, azaozz, furi3r, aristath, spacedmonkey, peterwilsoncc, mihai2u, gziolo.
Fixes#42438.
Built from https://develop.svn.wordpress.org/trunk@53846
git-svn-id: http://core.svn.wordpress.org/trunk@53405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The function executes an optimized query to get the last revision ID and total count. It was originally introduced for `WP_REST_Posts_Controller::prepare_links()`, and is now used in a few more places in core:
* `register_and_do_post_meta_boxes()`
* `wp_get_post_revisions_url()`
* `wp_update_custom_css_post()`
Follow-up to [53759], [53769], [53778], [53779], [53841].
Props peterwilsoncc, mukesh27, SergeyBiryukov.
Fixes#56279.
Built from https://develop.svn.wordpress.org/trunk@53842
git-svn-id: http://core.svn.wordpress.org/trunk@53401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates `wp_get_latest_revision_id_and_total_count()` and its usage to be a bit more descriptive and a bit less repetitive, e.g. `$revisions['latest_id']` instead of `$revision['revision']`.
Includes updating the `@return` tag to explain when the function returns a `WP_Error`.
Follow-up to [53759], [53769], [53778], [53779].
See #55857.
Built from https://develop.svn.wordpress.org/trunk@53841
git-svn-id: http://core.svn.wordpress.org/trunk@53400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Validate the requested sitemap is a string before attempting to use it in a provider. This prevents `WP_Sitemaps_Registry::get_provider()` from triggering a fatal error in more recent versions of PHP.
The errors can be triggered by items outside the site owner or developers control (such as a user visiting `?sitemap[foo]=bar`) so the code fails silently to avoid filling error logs with unfixable errors.
Props costdev, dd32.
Fixes#56336.
Built from https://develop.svn.wordpress.org/trunk@53838
git-svn-id: http://core.svn.wordpress.org/trunk@53397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There were two sets of tests for the function:
* One in the `link` directory, based on the `link-template.php` file name.
* One in the `term` directory, based on the component name.
To avoid confusion and make it easier to decide where new tests should go in the future, the existing tests are now combined in the former location.
Includes:
* Setting the current user in `::set_up()` instead of each individual test method.
* Changing the custom taxonomy name to `wptests_tax` for consistency with other tests.
* Moving `::register_custom_taxonomy()` and `::get_term()` helpers to the beginning of the class.
Follow-up to [32954], [36646], [52180], [52255], [53833].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53836
git-svn-id: http://core.svn.wordpress.org/trunk@53395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This makes the output when using the `--testdox` option more descriptive and is helpful when trying to debug which data set from a data provider failed the test.
Follow-up to [53818], [53821], [53822], [53834].
See #56198.
Built from https://develop.svn.wordpress.org/trunk@53835
git-svn-id: http://core.svn.wordpress.org/trunk@53394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A valid cache key for `wp_cache_*()` functions must be either an integer number or a non-empty string. To avoid potential compatibility issues or key collisions, a string that becomes empty after `trim()` should not be considered a valid cache key.
Follow-up to [53818], [53821], [53822].
Props tillkruess.
See #56198.
Built from https://develop.svn.wordpress.org/trunk@53834
git-svn-id: http://core.svn.wordpress.org/trunk@53393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* The tests use named data providers which include a flag for passing either a term ID or term object to the test, but the values for the flag were the opposite of what the array key says.
* Some array keys were duplicated, which means the earlier test case with the same name did not actually run.
Follow-up to [52180], [52255], [52258], [52305].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53833
git-svn-id: http://core.svn.wordpress.org/trunk@53392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This list was not up to date, and does not appear to be required, as `WP_UnitTestCase_Base::flush_cache()` adds the correct list of groups, which is up to date.
Follow-up to [1332/tests], [8068], [37613], [40561], [52976], [53826], [53828].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53829
git-svn-id: http://core.svn.wordpress.org/trunk@53388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This list was not up to date, and does not appear to be required, as `WP_UnitTestCase_Base::flush_cache()` adds the correct list of groups, which is up to date.
Follow-up to [1332/tests], [40343], [40561], [53823], [53824].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53826
git-svn-id: http://core.svn.wordpress.org/trunk@53385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changes the `$tags` variable used within `wp_set_post_terms()` to `$terms`.
While the default for the `$taxonomy` argument is `post_tag`, the function can be used to assign terms to a post for any taxonomy. When a different taxonomy is passed, `$tags` is an inaccurate name and could be confusing.
Props hilayt24, costdev, SergeyBiryukov, krishaweb, desrosj.
Fixes#56331.
Built from https://develop.svn.wordpress.org/trunk@53825
git-svn-id: http://core.svn.wordpress.org/trunk@53384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This list was not up to date due to missing `blog_meta` group, and does not appear to be required for the tests to pass, as `WP_UnitTestCase_Base::flush_cache()` adds the same list of groups, which is up to date.
Follow-up to [946/tests], [1332/tests], [40343], [42836], [53823].
See #55647.
Built from https://develop.svn.wordpress.org/trunk@53824
git-svn-id: http://core.svn.wordpress.org/trunk@53383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A valid cache key for `wp_cache_*()` functions must be either an integer number or a non-empty string. To avoid potential compatibility issues or key collisions, float values should not be considered a valid cache key.
Follow-up to [53818], [53821].
Props tillkruess, malthert, spacedmonkey.
See #56198.
Built from https://develop.svn.wordpress.org/trunk@53822
git-svn-id: http://core.svn.wordpress.org/trunk@53381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Some plugins may call the `wp_cache_*()` functions with an empty string, `false`, or `null` as cache key, usually as a result of not checking the return value of another function that's used as the key.
Previously, this was silently failing, leading to odd behavior at best and often breakage due to key collisions.
A valid cache key must be either an integer number or a non-empty string.
This commit introduces a quick type check on the given cache keys and adds a `_doing_it_wrong()` message that should help plugin developers to notice these issues quicker.
Includes:
* A check in `update_user_caches()` and `clean_user_cache()` to make sure user email is not empty before being cached or removed from cache, as it is technically possible to create a user with empty email via `wp_insert_user()`.
* Some minor cleanup in unit tests where the email was passed to `wp_insert_user()` incorrectly or was unintentionally reset.
Props tillkruess, malthert, dd32, spacedmonkey, flixos90, peterwilsoncc, SergeyBiryukov.
Fixes#56198.
Built from https://develop.svn.wordpress.org/trunk@53818
git-svn-id: http://core.svn.wordpress.org/trunk@53377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes WPCS errors in `WP_Site_Health::get_test_plugin_version()` and `::get_test_theme_version()`:
* `Expected exactly one space between closing parenthesis and opening control structure; " " found.`
* `Expected 1 space(s) after closing parenthesis; found 2`
Follow-up to [53816].
See #56134.
Built from https://develop.svn.wordpress.org/trunk@53817
git-svn-id: http://core.svn.wordpress.org/trunk@53376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This displays a more appropriate message in case the site does not have any active plugins or installed themes.
Follow-up to [44986], [45099], [45336].
Props Presskopp, costdev, martin.krcho, Clorith, SergeyBiryukov.
Fixes#56134.
Built from https://develop.svn.wordpress.org/trunk@53816
git-svn-id: http://core.svn.wordpress.org/trunk@53375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces the default "Just another WordPress site" tagline with an empty string for new installations. The reasoning is:
1. Not all themes display the tagline;
2. Not everyone changes the default tagline;
3. When people don't see the tagline in their theme, they may not realize it is still visible in some places, like feeds.
The string "Just another WordPress site" and the related multisite string: "Just another {NETWORK} site" are now only used as a placeholder for the tagline admin option.
Props markjaquith, Denis-de-Bernardy, westi, RyanMurphy, kovshenin, SergeyBiryukov, chriscct7, tyxla, hyperbrand, karmatosed, lukecavanagh, melchoyce, boemedia, khag7, sabernhardt, audrasjb, peterwilsoncc, costdev, martinkrcho, rafiahmedd.
Fixes#6479.
Built from https://develop.svn.wordpress.org/trunk@53815
git-svn-id: http://core.svn.wordpress.org/trunk@53374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes a behavior where a draft created with the same slug as an existing post would set the existing post to a 404.
`wp_unique_post_slug()` returns the same slug for 'draft' or 'pending' posts, so to ensure that a unique slug is generated, this changeset adds the post data with the 'publish' status to `wp_unique_post_slug()`.
Props Toro_Unit, h2ham, peterwilsoncc, costdev, antonvlasenko, azaozz, ironprogrammer, audrasjb, hellofromTonya.
Fixes#52422.
Built from https://develop.svn.wordpress.org/trunk@53813
git-svn-id: http://core.svn.wordpress.org/trunk@53372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
There are some table prefixes (for example, `7e1_`), which the database will try and parse as values unless they are quoted in backticks. Because not everyone remembers to quote their table names, WordPress discourages use of such prefixes during setup.
To test if the table prefix is valid, WordPress executes a query deliberately trying to generate an error:
> `Unknown column 'wp_' in 'field list'`
which means the prefix is safe to use, as the database was not able to parse it as a value.
Previously, this error would not be displayed to the user in a typical configuration, but would be logged on the server via `wpdb::print_error()`, and in some cases could block the installation.
This commit makes sure the error is still checked to display a proper message in case the prefix needs to be edited, but otherwise is silently discarded instead of being logged.
Follow-up to [37581], [41631], [51582].
Props pento, lazam786, Velochicdunord, irecinius, mikemanzo, dd32, blackawxs, codewhy, psykro, burgiuk, mdrago, maythamalsudany, peterwilsoncc, sumitsingh, deksar, SergeyBiryukov.
Fixes#42362.
Built from https://develop.svn.wordpress.org/trunk@53812
git-svn-id: http://core.svn.wordpress.org/trunk@53371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A separate file in the `actions` directory may have seemed like a good location at the time, but this is the only test left there. For consistency, it is now moved with the other action tests.
Follow-up to [1294/tests], [53806].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53808
git-svn-id: http://core.svn.wordpress.org/trunk@53367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was previously moved to a separate file to be excluded when running the tests on PHP 5.2.x.
Now that WordPress supports PHP 5.6.x or later, this can be moved back with the other action tests.
Follow-up to [299/tests], [301/tests], [862/tests], [866/tests], [963/tests].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53806
git-svn-id: http://core.svn.wordpress.org/trunk@53365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This replaces the "tag" wording with "hook name" where appropriate, to match the core function signatures.
Includes:
* Introducing a `::get_hook_names()` method instead of `::get_tags()`, keeping the latter as an alias.
* Adding a `hook_name` key to the `::$events` property, keeping `tag` for backward compatibility for now.
* Adding missing `@since` tags for class methods.
Follow-up to [24/tests], [62/tests], [70/tests], [50807], [53804].
See #55652.
Built from https://develop.svn.wordpress.org/trunk@53805
git-svn-id: http://core.svn.wordpress.org/trunk@53364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While most of the action functions are aliases for the respective filter functions, using `did_action()` to detect whether a filter has been run is not possible, as it only works specifically for actions.
This is now resolved by introducing a new function, `did_filter()`, which retrieves the number of times a filter has been applied during the current request, bringing parity with `did_action()`.
Follow-up to [4630], [6318], [27294].
Props mordauk, chriscct7, andykeith, nacin, dd32, markparnell, SergeyBiryukov.
Fixes#35357.
Built from https://develop.svn.wordpress.org/trunk@53803
git-svn-id: http://core.svn.wordpress.org/trunk@53362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This renames `$tax` to `$taxonomy_object` and `$s` to `$search` for clarity. The latter is only renamed when used as an internal variable and not referring to the `$s` global.
The list of affected functions:
* `wp_ajax_ajax_tag_search()`
* `wp_ajax_add_link_category`
* `wp_ajax_add_tag()`
* `wp_ajax_get_tagcloud()`
* `wp_ajax_inline_save_tax()`
* `wp_ajax_find_posts()`
Follow-up to [6542], [8901], [10222], [12833], [16771], [16992], [22723], [38698].
Props azouamauriac.
Fixes#55098.
Built from https://develop.svn.wordpress.org/trunk@53801
git-svn-id: http://core.svn.wordpress.org/trunk@53360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset ensures the "Logged in as" link conveys the information about its purpose ("Edit your profile") while the information "Logged in as Jane Doe" is only a simple text.
Props juliemoynat, SergeyBiryukov, joedolson, audrasjb, lopo.
Fixes#55718.
Built from https://develop.svn.wordpress.org/trunk@53796
git-svn-id: http://core.svn.wordpress.org/trunk@53355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In 6.0 there is now a functionality that allows to register selected remote patterns (from the Pattern Directory) via `theme.json`. However, it requires to fully enable all core and remote patterns. This can be a blocker for user adoption.
Many theme authors want to have all core and remote patterns disabled by default using `remove_theme_support( 'core-block-patterns' )`. This changeset ensures they are serving only patterns relevant to their theme.
This changeset removes theme support check from the function that registers remote patterns specified in `theme.json`. This allows theme authors to disable core patterns but then selectively register the ones they want from the Pattern Directory. If a theme author intentionally specifies patterns in `theme.json`, they probably intend for them to be present in the pattern inserter and the check is not required.
This change will make the Pattern Directory more appealing/usable from the theme author's perspective.
Props ndiego, ryelle.
Fixes#56112.
Built from https://develop.svn.wordpress.org/trunk@53793
git-svn-id: http://core.svn.wordpress.org/trunk@53352 1a063a9b-81f0-0310-95a4-ce76da25c4cd