Commit Graph

40302 Commits

Author SHA1 Message Date
Sergey Biryukov
144cb531fc Docs: Reference WP_Term_Query::__construct() in wp_list_categories() DocBlock for additional accepted arguments.
Clarify that `wp_dropdown_categories()` always returns a string, regardless of the `echo` parameter.

See #47896, #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@45895 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 16:59:53 +00:00
Boone Gorges
7dac24c681 Taxonomy: Standardize docs for wp_list_categories().
Many of the parameters historically documented on this function are merely
passed through to `get_categories()` and its underlying functions. In order to
avoid unnecessary duplication of function arguments, we remove documentation of
these parameters, and replace it with reference to the wrapped functions.

Parameters that receive special treatment or are otherwise changed before
being passed through continue to be documented as part of `wp_list_categories()`.

Props audrasjb, itowhid06, birgire.
Fixes #47896.

git-svn-id: https://develop.svn.wordpress.org/trunk@45894 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 15:23:48 +00:00
Boone Gorges
c2c8a6848d Taxonomy: Fix unique-slug check for terms with parents.
`wp_unique_term_slug()` appends numeric suffixes when the requested slug is
already in use by a sibling term. Changes introduced in [32837] inadvertently
caused this suffixing to be skipped in cases where the requested slug is
suffixed with the parent slug, so that it became possible to have two terms
`childslug-parentslug` underneath to the same `parentslug`. We fix this
regression by ensuring that the numeric-suffix routine runs in all cases.

Props yashar_hv, saskak, dlh.
Fixes #46431.

git-svn-id: https://develop.svn.wordpress.org/trunk@45893 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-26 15:18:40 +00:00
Andrew Ozz
152083be8f Docs: Improve and update the description of multi_resize() to explain changes and expected use.
See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45892 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 22:20:57 +00:00
Sergey Biryukov
252e14ac27 Menus: In wp_setup_nav_menu_item() and Walker_Nav_Menu_Edit::start_el(), check if the post or term associated with the menu item still exists to avoid a PHP notice.
If the associated post or term no longer exists, mark the menu item as invalid.

Props mehulkaklotar, kamrankhorsandi, cristiano.zanca, SergeyBiryukov.
Fixes #31703.

git-svn-id: https://develop.svn.wordpress.org/trunk@45891 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 21:31:43 +00:00
Sergey Biryukov
7ef2679ec7 Users: Adjust [45806] to make sure $all_userids is always defined.
Props kbrownkd.
Fixes #47936.

git-svn-id: https://develop.svn.wordpress.org/trunk@45890 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-25 20:02:31 +00:00
Sergey Biryukov
2e1de7309c Site Health: Add timezone to Site Health Info page.
Props justinahinon, sharaz, artisticasad, Rarst.
Fixes #47842.

git-svn-id: https://develop.svn.wordpress.org/trunk@45889 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-24 19:36:33 +00:00
Boone Gorges
3e704473e7 Taxonomy: Ensure consistency of hide_empty in term queries when taxonomy is excluded.
When querying for terms in hierarchical categories using `hide_empty=true`,
results have historically included parent terms which are themselves
unattached to any objects (are "empty") but which have non-empty descendent
terms. Because this process involves walking the descendant tree, we avoid it
when we detect that the queried taxonomies are not hierarchical. (This
behavior was introduced in [5525].)

When the `taxonomy` parameter of `get_terms()` was made optional - see #35495,
[36614] - it affected the mechanism for avoiding unneccessary tree walks,
since there may not be any explicitly declared taxonomies to run through
`is_taxonomy_hierarchical()`. As a result, term queries excluding `taxonomy`
did not check descendants, and empty parents with non-empty children were not
included in `hide_empty` results.

We correct the behavior by crawling term descendants when the `taxonomy`
argument is absent, which means that we're querying for terms in all taxonomies.

Props smerriman.
Fixes #37728.

git-svn-id: https://develop.svn.wordpress.org/trunk@45888 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 16:04:07 +00:00
Sergey Biryukov
ae2b4f9add Date/Time: Rewrite and simplify get_gmt_from_date(), get_date_from_gmt(), and iso8601_to_datetime() using wp_timezone().
Improve unit test coverage.

Props Rarst, goodevilgenius.
Fixes #31809.

git-svn-id: https://develop.svn.wordpress.org/trunk@45887 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 11:02:51 +00:00
Sergey Biryukov
b975a251ff Date/Time: Simplify the date comparing logic in WP_Community_Events::trim_events().
The Events API returns event date without timezone information, so trying to parse it into a timestamp and compare to a WP timestamp is pointless.

Props Rarst.
Fixes #47463.

git-svn-id: https://develop.svn.wordpress.org/trunk@45886 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 02:14:07 +00:00
Gary Pendergast
ece257ffd0 Build Tools: Pass the LOCAL_DIR environment variable through to the phpunit Docker container.
This allows code running inside the container to know whether it's supposed to be running in `build` or `src`.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45885 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:55:28 +00:00
Sergey Biryukov
ff36b9664f Date/Time: Revert unintended changes from [45882].
Props TimothyBlynJacobs.
See #25768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45884 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:15:16 +00:00
Sergey Biryukov
1c66cf519b Date/Time: Introduce current_datetime() for better time operations.
Returning a `DateTimeImmutable` representation of the current moment in time, this allows for a more flexible and reliable use than `current_time()` provides.

Props Rarst.
Fixes #47464.

git-svn-id: https://develop.svn.wordpress.org/trunk@45883 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 01:11:22 +00:00
Sergey Biryukov
67f7d1f4c7 Date/Time: Rewrite and simplify date_i18n() using wp_timezone() to address multiple issues with certain date formats and timezones, while preserving some extra handling for legacy use cases.
Improve unit test coverage.

Props Rarst, remcotolsma, raubvogel.
Fixes #25768.

git-svn-id: https://develop.svn.wordpress.org/trunk@45882 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-23 00:56:21 +00:00
Jonathan Desrosiers
0847b67b13 Coding Standards: Dynamic hooks should be named using interpolation not concatenation.
Props arena, desrosj.
Fixes #47052.

git-svn-id: https://develop.svn.wordpress.org/trunk@45881 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 19:07:57 +00:00
Sergey Biryukov
5a47302c35 Coding Standards: Add missing break for the default case in wp_privacy_anonymize_data().
Props itowhid06.
Fixes #47921.

git-svn-id: https://develop.svn.wordpress.org/trunk@45877 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 14:49:05 +00:00
Sergey Biryukov
4e129d1506 Date/Time: Use wp_timezone() in WP_Date_Query::build_mysql_datetime() to address timezone issues.
Improve unit test coverage.

Props Rarst, Biranit, birgire, jave.web, SergeyBiryukov.
Fixes #41782.

git-svn-id: https://develop.svn.wordpress.org/trunk@45876 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 03:10:05 +00:00
Gary Pendergast
8d5e4fed4d Build Tools: Don't use git for package installs.
While NPM supports installing packages from git locations, this requires `git` to be in the path, which won't necessarily be true, particularly on Windows.

We can download the release versions for these packages, instead.

Fixes #47916.



git-svn-id: https://develop.svn.wordpress.org/trunk@45875 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 02:28:50 +00:00
Sergey Biryukov
1ba44554be Users: Adjust [45708] to make sure wp_update_user() does not issue a WP_Error if a single site was previously set up as Multisite and there's still a spam field in the user table.
Add a unit test.

Props azaozz, SergeyBiryukov.
Fixes #45747.

git-svn-id: https://develop.svn.wordpress.org/trunk@45874 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 01:52:16 +00:00
Sergey Biryukov
7fbabd505d Administration: Adjust [45814] to address a backward compatibility issue for plugins passing multiple CSS classes to add_settings_error().
Only add the `notice-` prefix for `error`, `success`, `warning`, `info` CSS classes, keep other classes as is.

Add unit tests for `settings_errors()`.

Props afercia, SergeyBiryukov.
Fixes #44941.

git-svn-id: https://develop.svn.wordpress.org/trunk@45873 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-22 00:21:49 +00:00
Sergey Biryukov
6ea6591114 Docs: Correct type for the $deprecated argument of get_terms().
Props itowhid06.
Fixes #47915.

git-svn-id: https://develop.svn.wordpress.org/trunk@45872 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-21 16:26:47 +00:00
Sergey Biryukov
7b14e0c349 Docs: Fix typo in _wp_make_subsizes() DocBlock.
Props itowhid06.
Fixes #47913. See #40439.

git-svn-id: https://develop.svn.wordpress.org/trunk@45871 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-21 16:22:49 +00:00
Sergey Biryukov
fb189a6d5c Customizer: Trim whitespace from custom link URLs.
This complements a similar fix for the Menus screen in [45655].

Props donmhico, audrasjb.
Fixes #47888. See #47723.

git-svn-id: https://develop.svn.wordpress.org/trunk@45869 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-21 00:26:45 +00:00
Sergey Biryukov
2fb748bd1c Docs: Update @since tag for new JS functions and variables introduced in [45572].
Props garrett-eclipse.
See #47145.

git-svn-id: https://develop.svn.wordpress.org/trunk@45867 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 22:53:50 +00:00
Sergey Biryukov
23769b62c1 Twenty Seventeen: Fix tabs vs. spaces in [45764].
See #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45863 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 19:10:15 +00:00
Sergey Biryukov
92ba7258b0 Twenty Eleven: Fix tabs vs. spaces in [45763].
See #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45862 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 19:10:12 +00:00
Sergey Biryukov
c277879ad0 Twenty Seventeen: Adjust [45764] to conform to CSS Coding Standards.
See #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45861 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 19:05:30 +00:00
Sergey Biryukov
13f064a1c3 Twenty Eleven: Adjust [45763] to conform to CSS Coding Standards.
See #47414.

git-svn-id: https://develop.svn.wordpress.org/trunk@45860 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 19:05:24 +00:00
Sergey Biryukov
d471151f45 Tests: Remove $wpdb global reference from test_wp_insert_user_with_empty_data().
See #47902.

git-svn-id: https://develop.svn.wordpress.org/trunk@45859 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 17:27:17 +00:00
Sergey Biryukov
31a6309902 Users: In wp_insert_user(), account for the wp_pre_insert_user_data filter returning empty data.
Props juliobox, SergeyBiryukov.
Fixes #47902.

git-svn-id: https://develop.svn.wordpress.org/trunk@45858 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 17:25:02 +00:00
Sergey Biryukov
051aa3847c Date/Time: Fix race conditions in current_time() tests.
* Restore default timezone before performing assertions to avoid affecting other tests in case of failure.
* Use delta comparison for timestamps to avoid race conditions.

Props SergeyBiryukov, desrosj.
Fixes #45821.

git-svn-id: https://develop.svn.wordpress.org/trunk@45857 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-20 01:34:37 +00:00
Sergey Biryukov
91f60afbe5 Date/Time: Use PHP DateTime class API in current_time().
Only use the legacy WP timestamp approach (a sum of timestamp and timezone offset) for `timestamp` and `U` formats without the `$gmt` flag.

Otherwise, make sure the function returns correct local time for any format.

Props Rarst, jdgrimes.
Fixes #40653.

git-svn-id: https://develop.svn.wordpress.org/trunk@45856 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 21:05:42 +00:00
Sergey Biryukov
f5f2fc379e Coding Standards: Use long array syntax in Tests_WP_Timezone::timezone_offset_provider().
Per https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/, arrays must be declared using long array syntax for clarity.

See #24730.

git-svn-id: https://develop.svn.wordpress.org/trunk@45855 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 21:05:25 +00:00
Sergey Biryukov
c782ad4511 Coding Standards: Use KB_IN_BYTES in get_file_data().
See #22405, #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45854 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 20:09:11 +00:00
Sergey Biryukov
904b41e01c Date/Time: Introduce wp_timezone_string() and wp_timezone() for unified timezone retrieval.
* `wp_timezone_string()` retrieves the timezone from current settings as a string. Uses the `timezone_string` option to get a proper timezone if available, otherwise falls back to an offset.
* `wp_timezone()` retrieves the timezone from current settings as a `DateTimeZone` object. Timezone can be based on a PHP timezone string or a `±HH:MM` offset.

Props Rarst, remcotolsma, johnjamesjacoby, rmccue.
Fixes #24730.

git-svn-id: https://develop.svn.wordpress.org/trunk@45853 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 19:07:03 +00:00
Sergey Biryukov
f2b6c12ddb Coding Standards: Fix WPCS violations in [45851].
See #25347.

git-svn-id: https://develop.svn.wordpress.org/trunk@45852 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 16:34:57 +00:00
Sergey Biryukov
896da178e0 Date/Time: In wp_insert_post(), when checking the post date to set future or publish status, use string comparison to work around far future dates (year 2038+) on 32-bit systems.
Props Rarst, nofearinc.
Fixes #25347.

git-svn-id: https://develop.svn.wordpress.org/trunk@45851 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 15:49:32 +00:00
Sergey Biryukov
0f8ba2cf2a Date/Time: In WP_Date_Query::__construct(), return early if $date_query is empty or not an array.
Props vishalkakadiya.
Fixes #47392.

git-svn-id: https://develop.svn.wordpress.org/trunk@45850 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 15:16:18 +00:00
Gary Pendergast
4e0499e5bf Tests: Add an xdebug group for tests that require xdebug.
These tests are now also run as their own part of the Travis build, to ensure performance of other tests isn't affected by the presence of xdebug.

Fixes #40532.



git-svn-id: https://develop.svn.wordpress.org/trunk@45827 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-19 02:17:50 +00:00
Tammie Lister
9260916964 Multisite: Remove truncation to allow clearers identification of longer site names
Previously the sites were truncated which meant longer names but with ending identifications were unable to be seen as different. This shows the full site name to allow easier understanding.

Props tferry, melinedo, afercia, jeremyfelt
Fixes: 47112


git-svn-id: https://develop.svn.wordpress.org/trunk@45826 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-18 12:29:30 +00:00
Sergey Biryukov
95c36ce5ba Privacy: Add descriptions for sections in a personal data export file.
Props garrett-eclipse, Venutius, karmatosed.
Fixes #45491.

git-svn-id: https://develop.svn.wordpress.org/trunk@45825 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-18 02:07:00 +00:00
Sergey Biryukov
6f30523ce9 Plugins: Adjust margin for plugin headings on "Add Plugins" screen to avoid overlapping with "Network Activate" button.
Props justinahinon, chetan200891.
Fixes #47600.

git-svn-id: https://develop.svn.wordpress.org/trunk@45824 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-17 14:33:01 +00:00
Sergey Biryukov
e810b32f42 Pings/Trackbacks: In wp_xmlrpc_server::pingback_ping(), strip inline JS and CSS while trying to figure out the pingback context.
Props david.binda.
Fixes #47283.

git-svn-id: https://develop.svn.wordpress.org/trunk@45823 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-17 13:58:12 +00:00
Sergey Biryukov
c5438c3720 Docs: Improve documentation for wp_set_auth_cookie() and related functions.
Props arafat, SergeyBiryukov.
Fixes #47886.

git-svn-id: https://develop.svn.wordpress.org/trunk@45822 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-17 13:22:26 +00:00
John Blackbourn
b675f56c4f Docs: Add a missing return type.
See #47110


git-svn-id: https://develop.svn.wordpress.org/trunk@45821 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 19:34:31 +00:00
K. Adam White
4bb45c674a Add @ticket annotations for [45812].
Props birgire.
See #43709.



git-svn-id: https://develop.svn.wordpress.org/trunk@45820 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 03:32:23 +00:00
Gary Pendergast
a100d0cf52 Build Tools: Improve local-env start behaviour under Docker Toolbox.
Docker Toolbox requires port forwarding to be configured, but generates error when trying to forward a port that's already been taken.

This change removes clashing port forwarding rules before adding our own.

See #47767.



git-svn-id: https://develop.svn.wordpress.org/trunk@45819 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 01:39:59 +00:00
Sergey Biryukov
f3241f4883 Administration: Replace legacy updated message type in add_settings_error() calls with success.
See #44640.

git-svn-id: https://develop.svn.wordpress.org/trunk@45818 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:38:42 +00:00
Sergey Biryukov
e961891e1b Taxonomy: In feed_links_extra() and get_the_archive_title(), make sure the queried taxonomy term exists before accessing its properties.
Props donmhico, truchot, zaantar.
Fixes #46420.

git-svn-id: https://develop.svn.wordpress.org/trunk@45817 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:23:40 +00:00
Sergey Biryukov
beb1d3a7b5 Coding Standards: In wlwmanifest_link(), use concatenation instead of commas for echo, for consistency with rsd_link() and the rest of core.
See #47632.

git-svn-id: https://develop.svn.wordpress.org/trunk@45816 602fd350-edb4-49c9-b593-d223f7449a82
2019-08-16 00:20:58 +00:00