Adds more complete parameter descriptions for the `$term` and `$taxonomy` parameters.
Props amruta123.b for the initial patch.
Fixes#29901.
git-svn-id: https://develop.svn.wordpress.org/trunk@29866 602fd350-edb4-49c9-b593-d223f7449a82
This change brings return values for failures of this sort in line with other
failed lookups in term_exists(): a null value is now returned in all cases
where the queried term is not found.
Adds unit test for the sanitization issue. Modifies existing unit test to
reflect the change in return value for empty term strings.
Props boonebgorges, georgestephanis.
Fixes#29589.
git-svn-id: https://develop.svn.wordpress.org/trunk@29865 602fd350-edb4-49c9-b593-d223f7449a82
These unit tests cover the expected vehaviour of certain combinations of URL's, but makes no attempt to test invalid URL structures, as PHP's behavious for invalid URL's is undefined (Some will be treated as paths, others fail, and it varies between PHP 5.4.7+ and <5.4.7).
This change also makes WP_HTTP::parse_url() protected in order to allow unit testing.
See #28001, #29886
git-svn-id: https://develop.svn.wordpress.org/trunk@29864 602fd350-edb4-49c9-b593-d223f7449a82
Passing a 0 (or '0') as the 'parent' param of term_exists() should limit
results to terms with no parent.
Adds unit test.
Fixes#29851.
git-svn-id: https://develop.svn.wordpress.org/trunk@29863 602fd350-edb4-49c9-b593-d223f7449a82
Using get_term_by() rather than direct SQL queries to fetch the alias term
fixes a number of issues:
* Object cache for aliased term is properly cleared after update.
* If the aliased term is in the object cache, it's served from there, saving a database query.
* Duplicate 'edit_terms' and 'edited_terms' hooks can be removed.
* Fix a PHP notice when the 'alias_of' term is not found.
* Prevent the incorrect creation of a new term group for the primary term when the 'alias_of' term is not found.
Adds unit tests for 'alias_of' functionality in both functions.
Fixes#29848.
git-svn-id: https://develop.svn.wordpress.org/trunk@29862 602fd350-edb4-49c9-b593-d223f7449a82
In older versions of PHP:
- parse_url() will fail to parse a url where the scheme break (://) is present in a relative URL's path
- parse_url() will include the hostname of a schemeless URL in the path component
This handles those two types of URL's by correcting the response from parse_url().
Fixes#28001, #29886
git-svn-id: https://develop.svn.wordpress.org/trunk@29861 602fd350-edb4-49c9-b593-d223f7449a82
Registering a post type or taxonomy during a unit test causes modifications to
global variables. If the test fails to clean up these globals - either by
neglecting to call _unregister_post_type()/_unregister_taxonomy() at all or by
failing before getting a chance to do so - tests that run later in the suite
can fail, leading to much gnashing of teeth. Wiping all taxonomies and
restoring to the defaults before each test ensures that we always start with a
clean slate.
Fixes#29827.
git-svn-id: https://develop.svn.wordpress.org/trunk@29860 602fd350-edb4-49c9-b593-d223f7449a82
In certain edge cases, such as during the automated test suite,
create_initial_taxonomies() can be called in a situation where a non-default
permastruct setting has been saved outside of wp-admin. This causes the
'hierarchical' setting for the post_tag taxonomy to remain unset, leading to
PHP notices in get_term_link().
See #29827.
git-svn-id: https://develop.svn.wordpress.org/trunk@29859 602fd350-edb4-49c9-b593-d223f7449a82
This is for translation files in WP_LANG_DIR which are installed through a language pack.
Change `wp_get_installed_translations()` to only return a translation if the .mo file also exists.
fixes#29860.
git-svn-id: https://develop.svn.wordpress.org/trunk@29856 602fd350-edb4-49c9-b593-d223f7449a82
When using legacy `meta_key`, `meta_value`, etc. arguments in `WP_Query`,
they're converted into the first clause of a `meta_query`. By using that
clause instead of the original arguments, we make sure that behavior is
consistent between the two available formats.
props boonebgorges.
fixes#16814.
git-svn-id: https://develop.svn.wordpress.org/trunk@29855 602fd350-edb4-49c9-b593-d223f7449a82
A valid relative URL could be mistaken for an absolute url if it contained a :// in any position of the url.
Fixes#28001
git-svn-id: https://develop.svn.wordpress.org/trunk@29850 602fd350-edb4-49c9-b593-d223f7449a82
Previously this would use the generic message corresponding to the response code, which isn't always accurate. Since we're already parsing the headers, we can simply return that directly (This also has the benefit that it's the same code for both Streams and Curl header handling).
Fixes#28919
git-svn-id: https://develop.svn.wordpress.org/trunk@29848 602fd350-edb4-49c9-b593-d223f7449a82
Because jQUI's build process no longer provides individual minified files we need some additional changes:
* Rename all files, remove the "jquery.ui." prefix. Add old files to `$_old_files`.
* Add and use non-minified files in /src.
* Add grunt task to minify jQuery UI files.
* (Non-minified files will not be shipped.)
Changelogs:
* http://jqueryui.com/changelog/1.11.0/
* http://jqueryui.com/changelog/1.11.1/
props Fab1en, ocean90.
fixes#29833.
git-svn-id: https://develop.svn.wordpress.org/trunk@29847 602fd350-edb4-49c9-b593-d223f7449a82
Not having the count caused queries with 'fields' values of 'id=>name' and
'id=>slug' to return incorrect results when querying a hierarchical taxonomy
with 'hide_empty=true'.
Includes unit tests for get_terms() when using various combinations of 'fields',
'hide_empty', and 'hierarchical' arguments.
Props technical_mastermind.
Fixes#29859.
git-svn-id: https://develop.svn.wordpress.org/trunk@29845 602fd350-edb4-49c9-b593-d223f7449a82
PHP 5.6 was released on 28 August 2014 and thus tests on it should be on the same level as all of our other PHP tests pass.
Fixes#29682
Props netweb
git-svn-id: https://develop.svn.wordpress.org/trunk@29844 602fd350-edb4-49c9-b593-d223f7449a82
Adds documentation pointers from the class-level doc for `WP_User_Query`, as well as the `get_users()` doc.
Props tschutter.
Fixes#29846.
git-svn-id: https://develop.svn.wordpress.org/trunk@29843 602fd350-edb4-49c9-b593-d223f7449a82
If someone turns on support SVG files, this will allow them to show up.
Props arippberger for an initial patch.
Fixes#26256.
git-svn-id: https://develop.svn.wordpress.org/trunk@29832 602fd350-edb4-49c9-b593-d223f7449a82
Previously, a 'user_nicename' parameter passed into the function was
unsanitized. This could result in a mismatch between the sanitized nicename
generated automatically at user creation, resulting in broken author archive
permalinks.
Props joemcgill.
Fixes#29696.
git-svn-id: https://develop.svn.wordpress.org/trunk@29819 602fd350-edb4-49c9-b593-d223f7449a82