* Add an `$exclude` parameter to `recurse_dirsize()`.
* Use this parameter in `get_dirsize()` to exclude `/sites` when on the main site.
* Add tests for main site and switched site.
Props @earnjam, @jeremyfelt.
Fixes#30202.
git-svn-id: https://develop.svn.wordpress.org/trunk@33184 602fd350-edb4-49c9-b593-d223f7449a82
Test to make sure that dbDelta properly inserts a value into the DB.
Props tryon, jtsternberg, ebinnion, JPry, avnarun, kevkoeh, salcode.
Fixes#29020.
git-svn-id: https://develop.svn.wordpress.org/trunk@33175 602fd350-edb4-49c9-b593-d223f7449a82
In step with the UI provided by `wp-admin/network/users.php`, super admin privileges must be removed before a user can be deleted through the API.
Props @johnjamesjacoby, @jeremyfelt.
Fixes#32935.
git-svn-id: https://develop.svn.wordpress.org/trunk@33143 602fd350-edb4-49c9-b593-d223f7449a82
Also includes these related changes:
* Export `oldContainer` and `newContainer` among the `customize-preview-menu-refreshed` event params for themes to be able to more easily re-initialize the DOM elements.
* Improve performance for partial refresh by only sending settings related to the menu being previewed.
* Fix previewing of menu assigned to Custom Menu by exporting a menu `term_id` as opposed to an object, as the former is more stable for comparing in in args hashes.
* Do full refresh of preview when nav menu unassigned so that the layout can be updated.
* Harden conditions for when partial refresh is eligible for a `wp_nav_menu()` instance.
Fixes#32841.
git-svn-id: https://develop.svn.wordpress.org/trunk@33138 602fd350-edb4-49c9-b593-d223f7449a82
These args only need to be cleared out when exported to JavaScript, when they are not JSON-serializable. So the filter now clears these when gathering args for exporting to JS, but otherwise now leaves the original values to be passed through to `wp_nav_menu()`.
Fixes#32781.
git-svn-id: https://develop.svn.wordpress.org/trunk@33131 602fd350-edb4-49c9-b593-d223f7449a82
Includes two modifications for WordPress:
* Removes support for NTLM in `class-smtp.php` since the required client (`extras/ntlm_sasl_client.php`) is not distributed as part of WordPress.
* Requires `class-smtp.php` for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used. See [27385].
This also includes a change to our `MockMailer` for unit tests. It now overrides `postSend() instead of `send()`, and `preSend()`.
`preSend()` resets `$this->Encoding` because PHPMailer doesn't clean up after itself / presets all variables. This becomes an issue when `PHPMailer::createBody()` sets `$this->Encoding = 'quoted-printable'` (away from it's default of 8bit) when it encounters a line longer than 998 characters. `Tests_Comment::test_comment_field_lengths` is such a case.
props MattyRob, dd32.
fixes#28909.
git-svn-id: https://develop.svn.wordpress.org/trunk@33124 602fd350-edb4-49c9-b593-d223f7449a82
If you are subclassing these classes in your own tests, you'll need to update your code.
Props johnbillion
See #31982
git-svn-id: https://develop.svn.wordpress.org/trunk@33123 602fd350-edb4-49c9-b593-d223f7449a82
In cases where a user has the `edit_others_posts` capability but not
`publish_posts`, it was possible for that user to unstick a post after editing,
since the input field was never made available in that context.
Props ericmann, chriscct7.
Fixes#24153.
git-svn-id: https://develop.svn.wordpress.org/trunk@33096 602fd350-edb4-49c9-b593-d223f7449a82
Only 60 characters can be stored in the database for a username, which could cause lookup issues when attempting to use similar usernames of extreme length.
Props @DJPaul.
See #17904, Fixes#26784.
git-svn-id: https://develop.svn.wordpress.org/trunk@33083 602fd350-edb4-49c9-b593-d223f7449a82
Adds validation for initially-supplied nav menu name, blocking empty names from being supplied. If later an empty name is supplied and the nav menu is saved, the name "(unnamed)" will be supplied instead and supplied back to the client. If a name is supplied for the menu which is currently used by another menu, then the name conflict is resolved by adding a numerical counter similar to how `post_name` conflicts are resolved. Includes unit tests.
Fixes#32760.
git-svn-id: https://develop.svn.wordpress.org/trunk@33071 602fd350-edb4-49c9-b593-d223f7449a82
The mailto protocol is a bit different than the other protocols in that new lines are something you might realistically want to include. Includes tests to make sure that http protocol urls that contain mailto: aren't affected. Tests for stripping newlines in general already exist.
Fixes#31632
Props danielbachhuber
git-svn-id: https://develop.svn.wordpress.org/trunk@33064 602fd350-edb4-49c9-b593-d223f7449a82
Pages are static content, for which comments are not expected out of the box.
Props valendesigns, rachelbaker.
Fixes#31168.
git-svn-id: https://develop.svn.wordpress.org/trunk@33041 602fd350-edb4-49c9-b593-d223f7449a82
* A variant of a language has its own locale, for example the locale of the formal variant of German is `de_DE_formal`.
* Update `remove_accents()` and some CSS rules to support `de_DE_formal`.
* Add tests for `get_bloginfo( 'language' )`.
* API changes will be deployed over the next few days.
see #28303.
git-svn-id: https://develop.svn.wordpress.org/trunk@33027 602fd350-edb4-49c9-b593-d223f7449a82
The new parameter creates inconsistencies in the signatures of the various
functions for fetching term links (`get_term_feed_link()`,
`get_edit_term_link()`, etc.).
Reverts [32553].
See #14156.
git-svn-id: https://develop.svn.wordpress.org/trunk@33022 602fd350-edb4-49c9-b593-d223f7449a82
[32994] results in an additional database query during automated testing, so
the query count being compared in this specific test must be incremented
manually.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@32997 602fd350-edb4-49c9-b593-d223f7449a82
This filter allows developers to modify the data that is used to create tag
clouds, without having to manipulate the tag cloud markup directly.
As part of the refactor, this changeset also adds a few unit tests for the way
`wp_generate_tag_cloud()` generates the 'title' attribute, as well as
improvements to output escaping.
Props flixos90, ysalame.
Fixes#24656.
git-svn-id: https://develop.svn.wordpress.org/trunk@32996 602fd350-edb4-49c9-b593-d223f7449a82
PHP7 is deprecating PHP4 style constructors, so we need to modify our code to have _construct methods that fire before the named PHP4 style constructors. The PHP4 style constructors will call the PHP5 style constructor in case it is being called directly (usually via parent::METHOD).
This modifies external libraries to add PHP5 style constructors, but doesn't add a notice for when they are used. In WordPress core code, PHP4 style constructors are being given a call to _deprecated_constructor. To the PHP4 style constructor I say "I know that I can't take no more | It ain't no lie | I wanna see you out that door | Baby, bye, bye, bye..."
Upstream: https://wiki.php.net/rfc/remove_php4_constructors
Props jdgrimes, netweb, jorbin
See #31982
git-svn-id: https://develop.svn.wordpress.org/trunk@32990 602fd350-edb4-49c9-b593-d223f7449a82
The function should not throw notices when an improper term or taxonomy is
passed.
Props tmatsuur, MikeHansenMe.
Fixes#32786.
git-svn-id: https://develop.svn.wordpress.org/trunk@32954 602fd350-edb4-49c9-b593-d223f7449a82
[31467] included a change that involved generating meta_query SQL before the
`pre_get_comments` hook, with the result that `pre_get_comments` callbacks were
no longer able to modify comment meta queries. We fix the problem by moving the
SQL generation to after the hook.
This changeset also includes a second call to `meta_query->parse_query_vars()`,
to ensure that modifications to metadata-related query vars (such as `meta_key`
and `meta_value`) performed in `pre_get_comments` callbacks have the expected
effect on the comment query.
Fixes#32762.
git-svn-id: https://develop.svn.wordpress.org/trunk@32911 602fd350-edb4-49c9-b593-d223f7449a82
* Make sure that strings ending with a number and quotation mark get the proper smart quotes
* Introduce `wptexturize_primes()`, a logic tree to determine whether or not "7'." represents seven feet, then converts the special char into either a prime char or a closing quote char.
Adds unit tests.
Props miqrogroove.
Fixes#29256.
git-svn-id: https://develop.svn.wordpress.org/trunk@32863 602fd350-edb4-49c9-b593-d223f7449a82
* The WordCounter should only do one thing: count words. This makes it also easier to test.
* Add some really basic unit tests.
* Instead of only refreshing the count on enter and delete, refresh the count when the user stops typing. Also look at paste and content changes in TinyMCE.
* Use `match` instead of `replace` when it is appropriate.
* More readable code.
See #30966. Fixes#26620.
git-svn-id: https://develop.svn.wordpress.org/trunk@32856 602fd350-edb4-49c9-b593-d223f7449a82