Setting 'show_in_quick_edit' to false when registering a custom taxonomy will
hide the taxonomy when editing posts using Quick Edit.
The new 'quick_edit_show_taxonomy' filter allows this behavior to be filtered
on a finer scale, as when you want a given taxonomy to be hidden for one post
type but not for others.
Props hlashbrooke.
Fixes#26948.
git-svn-id: https://develop.svn.wordpress.org/trunk@31307 602fd350-edb4-49c9-b593-d223f7449a82
These methods provide a procedural alternative to the `@expectedDeprecated`
and `@expectedIncorrectUsage` test annotations, and parallel PHPUnit's native
`setExpectedException()`.
Props prasoon2211, jdgrimes.
Fixes#28486.
git-svn-id: https://develop.svn.wordpress.org/trunk@31306 602fd350-edb4-49c9-b593-d223f7449a82
Uncached results pulled from `wp_get_object_terms()` are zero-indexed (ie 0,
1, 2...). As a result, `get_the_terms()` was returning a strictly different
array when pulling from the cache and when the cache was empty.
Props joshlevinson.
Fixes#31086.
git-svn-id: https://develop.svn.wordpress.org/trunk@31287 602fd350-edb4-49c9-b593-d223f7449a82
`meta_query` tests have been moved to `tests/phpunit/tests/query/metaQuery.php` and `tax_query` tests to `tests/phpunit/tests/query/taxQuery.php`. This is an improvement because (a) it better corresponds to the way that other `WP_Query` parameter tests are organized, (b) splitting meta and tax tests into separate classes simplifies the required `@group` annotations, and (c) the tests have nothing to do with posts per se, and so do not belong in the `post` subdirectory.
The tests previously found at `tests/phpunit/tests/query/taxQuery.php` have been moved to `isTerm.php` in the same directory. These tests are related to the `is_*` functions that have to do with taxonomy terms, like `is_category()`.
See #26999.
git-svn-id: https://develop.svn.wordpress.org/trunk@31286 602fd350-edb4-49c9-b593-d223f7449a82
Previously, attempts to descend the family tree of each term were done using
the first taxonomy in the `$taxonomies` array, with the result that terms not
belonging to that taxonomy were not found and their children not properly
parsed. We fix this bug by fetching each term's taxonomy with the SQL query,
and then using that taxonomy to get the correct children for each term.
Fixes#31118.
git-svn-id: https://develop.svn.wordpress.org/trunk@31285 602fd350-edb4-49c9-b593-d223f7449a82
These tests fail on multisite if run after a test that creates
`wpmu_create_blog()`, because `wpmu_create_blog()` defines `WP_INSTALLING`,
which results in unexpected cache misses. See [28965] for a similar fix.
git-svn-id: https://develop.svn.wordpress.org/trunk@31280 602fd350-edb4-49c9-b593-d223f7449a82
The test uses the `_block_comments()` method to prevent comment inserts from
happening. Since [31263], failed comment inserts lead to the comment content's
being stripped of invalid characters and inserted again. By immediately
unhooking itself after first being run, `_block_comments()` was causing the
INSERT block to work only for the first attempt, while the second attempt was
going through, causing the test to fail. As a fix, we move the
`remove_filter()` call to the class's `tearDown()` method - sufficient for
cleanup, but late enough that *all* comment inserts will be blocked for the
test method in question.
See #21212.
Since [31263], comment INSERT queries that were pseudo-bl
git-svn-id: https://develop.svn.wordpress.org/trunk@31277 602fd350-edb4-49c9-b593-d223f7449a82
There is a pre-check in `get_terms()` that prevents an unnecessary database
query if the 'parent' or 'child_of' parameter is not found in the cached term
hierarchy (since a term without an index in the hierarchy cache has no
descendants). Previously, only the first item in the `$taxonomies` array was
being checked, with the result that an empty array was being erroneously
returned in cases where the 'parent' or 'child_of' term is in a subsequent
taxonomy.
See #31118.
git-svn-id: https://develop.svn.wordpress.org/trunk@31276 602fd350-edb4-49c9-b593-d223f7449a82
This new parameter allows developers to limit queried terms to terminal nodes -
ie, those without any descendants.
As part of the improvement, some internal logic in `get_terms()` has been
consolidated. Parameters that resolve to a NOT IN clause containing term IDs
('exclude', 'exclude_tree', and 'childless') are now parsed into a single
"exclusions" array before the SQL clause is generated.
Props theMikeD, horike.
Fixes#29839.
git-svn-id: https://develop.svn.wordpress.org/trunk@31275 602fd350-edb4-49c9-b593-d223f7449a82
This makes it so that we don't have to mark the test as skipped when running
through Imagick tests.
See #30284.
git-svn-id: https://develop.svn.wordpress.org/trunk@31257 602fd350-edb4-49c9-b593-d223f7449a82
This prevents infinite loops that lead to PHP nesting limit fatal errors.
Props boonebgorges, sgrant.
Fixes#24461.
git-svn-id: https://develop.svn.wordpress.org/trunk@31207 602fd350-edb4-49c9-b593-d223f7449a82
Taxonomy hierarchy loops should not occur naturally, but when they do, the
logic of `_pad_term_counts()` could result in infinite loops, leading to
timeouts. We avoid this by breaking when a loop is detected.
Fixes#20635.
git-svn-id: https://develop.svn.wordpress.org/trunk@31206 602fd350-edb4-49c9-b593-d223f7449a82
Since 4.1 [29780], the default value of the 'add_args' argument in
`paginate_links()` has been determined by parsing the current URL. This change
had the side effect of overriding custom values of 'format' that changed the
pagination query var, with the result that plugins using `paginate_links()`
with a custom format generated the incorrect links unless explicitly
declaring 'add_args=false' to prevent the default values from overriding. We
fix this behavior by parsing URL query vars into the 'add_args' array only
after the explicit function params have been parsed, and by skipping the
current page's pagination query var when doing this parsing (to avoid the
override).
Props obenland.
Fixes#30831 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@31203 602fd350-edb4-49c9-b593-d223f7449a82
Introduced in [29925], `validate_date_values()` throws `_doing_it_wrong()`
notices when values passed as part of a `WP_Date_Query` do not reflect actual
dates. However, the validation did not account properly for the case where an
array of multiple values is passed, as when doing IN or BETWEEN queries.
Props dlh.
Fixes#31001 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@31179 602fd350-edb4-49c9-b593-d223f7449a82
Ensure leading and traling slashes are in place and don't touch anything in the middle. Validating with `array_filter()` would have missed a possible valid falsy path - `/my-path/0/`.
Props nacin.
Fixes#18117.
git-svn-id: https://develop.svn.wordpress.org/trunk@31158 602fd350-edb4-49c9-b593-d223f7449a82
* Prevent a notice when an invalid ID is used with `get_blogaddres_by_id()`.
* Return a falsy empty string rather than the previous "http://".
* Add unit tests for `get_blogaddress_by_id()`.
Props nerrad.
Fixes#30566.
git-svn-id: https://develop.svn.wordpress.org/trunk@31157 602fd350-edb4-49c9-b593-d223f7449a82
In multisite, core expects the stored value for a site's path to have leading and trailing slashes. When these slashes are missing, it becomes impossible to visit the site.
This enforces proper `/path/` creation in `update_blog_details()`, most likely used when updating an existing site through `site-info.php`.
Props earnjam, simonwheatley.
Fixes#18117. Fixes#23865.
git-svn-id: https://develop.svn.wordpress.org/trunk@31155 602fd350-edb4-49c9-b593-d223f7449a82
[29863] made the corresponding change in `term_exists()`. Failure to change the
default value in `category_exists()` meant that an unspecified value for
`$parent` would limit results to top-level categories.
Includes unit tests and corrected function documentation.
Props hissy.
Fixes#30975 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@31140 602fd350-edb4-49c9-b593-d223f7449a82
We already do this for other non-public statuses, to prevent leaking non-public
information about unpublished posts.
Props e.mazovetskiy, CalEvans.
Fixes#30910.
git-svn-id: https://develop.svn.wordpress.org/trunk@31114 602fd350-edb4-49c9-b593-d223f7449a82