Commit Graph

31792 Commits

Author SHA1 Message Date
Scott Taylor
8d1161392a Unit Tests: tests that want to flush the cache should use their instance method instead of calling wp_cache_flush() - more properties need to be wiped out in between tests.
Props ocean90.
See #31491.

Built from https://develop.svn.wordpress.org/trunk@34766


git-svn-id: http://core.svn.wordpress.org/trunk@34731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 05:09:25 +00:00
Scott Taylor
51cdca0906 Unit Tests: in Tests_Cache::test_wp_cache_init(), when wp_using_ext_object_cache(), just check that the global is an instance of WP_Object_Cache. External object cache instances of WP_Object_Cache will contain resources as props that will always have differing internal IDs, so strict comparison won't work.
See #31491.

Built from https://develop.svn.wordpress.org/trunk@34765


git-svn-id: http://core.svn.wordpress.org/trunk@34730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 05:06:24 +00:00
Drew Jaynes
769ad80521 Docs: Also clarify the expected element types depending on the value of $action in the hook doc for the plugins_api filter.
See [34763] for context.

See #34035.

Built from https://develop.svn.wordpress.org/trunk@34764


git-svn-id: http://core.svn.wordpress.org/trunk@34729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 04:52:25 +00:00
Drew Jaynes
8478a1341b Docs: Clarify the expected replacement element type if replacing the object or array in plugins_api() via the plugins_api hook.
If the `$action` type is 'query_plugins' or 'plugin_information', the API will return an object, thus an object should be passed if replacing it. For 'hot_tags' and 'hot_categories', the same logic applies, but with arrays instead.

See #34035.

Built from https://develop.svn.wordpress.org/trunk@34763


git-svn-id: http://core.svn.wordpress.org/trunk@34728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 04:48:25 +00:00
Scott Taylor
5c6c4e3713 Posts: In wp_insert_post(), don't set post_date to current time if it can be derived from a passed value for post_date_gmt.
Adds unit tests.

Props oso96_2000, kawauso.
Fixes #15946.

Built from https://develop.svn.wordpress.org/trunk@34762


git-svn-id: http://core.svn.wordpress.org/trunk@34727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 04:36:24 +00:00
Scott Taylor
7a0f8602f3 Shortcodes/Formatting: Add PCRE Performance Testing
* Move pattern from `wptexturize()` into a separate function.
* Move pattern from `wp_html_split()` into a separate function.
* Beautify code for `wp_html_split()`.
* Remove unnecessary instances of `/s` modifier in patterns that don't use dots.
* Add `tests/phpunit/data/formatting/whole-posts.php` for testing larger strings.
* Add function `benchmark_pcre_backtracking()`.
* Add tests for `wp_html_split()`.
* Add tests for `wptexturize()`.
* Add tests for `get_shortcode_regex()`.

Props miqrogroove.
Fixes #34121.

Built from https://develop.svn.wordpress.org/trunk@34761


git-svn-id: http://core.svn.wordpress.org/trunk@34726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 04:26:25 +00:00
Scott Taylor
da1c938a5c Plugins: on the Install page, move the name of each plugin into the <h4> to accommodate screen readers.
Props afercia, ChrisMKindred.
Fixes #32400.

Built from https://develop.svn.wordpress.org/trunk@34760


git-svn-id: http://core.svn.wordpress.org/trunk@34725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 04:16:27 +00:00
Jeremy Felt
ddc1670e90 Tests: Clarify site option tests storing and retrieving serialized data.
See #28290.

Built from https://develop.svn.wordpress.org/trunk@34759


git-svn-id: http://core.svn.wordpress.org/trunk@34724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 02:06:26 +00:00
Jeremy Felt
8908480594 Tests: Split test_default_filter() Site Option test into multiple tests.
See #28290.

Built from https://develop.svn.wordpress.org/trunk@34758


git-svn-id: http://core.svn.wordpress.org/trunk@34723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 01:56:26 +00:00
Jeremy Felt
a7a239b39b Tests: Split test_the_basics() Site Option test into many tests.
Many assertions in one test are now many tests with one assertion.

See #28290.

Built from https://develop.svn.wordpress.org/trunk@34757


git-svn-id: http://core.svn.wordpress.org/trunk@34722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 01:33:50 +00:00
Jeremy Felt
e2c6216b21 MS: Remove @todo for ms_protect_special_option() from delete_site_option().
This todo has been in place since the original merge of MU. At the time of merge, `wpmu_protect_special_option()` protected an empty array, and there has been no noticeable need since. As we introduce `_network_option()`, let's leave this behind. A new ticket can be opened if necessary.

See #28290.

Built from https://develop.svn.wordpress.org/trunk@34756


git-svn-id: http://core.svn.wordpress.org/trunk@34721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:46:28 +00:00
John Blackbourn
ea28454867 Deprecate get_admin_users_for_domain(). This function has never been used in core.
Fixes #34122

Built from https://develop.svn.wordpress.org/trunk@34755


git-svn-id: http://core.svn.wordpress.org/trunk@34720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:27:24 +00:00
John Blackbourn
f33c6a6650 This function is blessed.
Built from https://develop.svn.wordpress.org/trunk@34754


git-svn-id: http://core.svn.wordpress.org/trunk@34719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:24:24 +00:00
John Blackbourn
d0d9e4c8d8 Deprecate create_empty_blog(). This function has never been used in core.
Fixes #34120

Built from https://develop.svn.wordpress.org/trunk@34753


git-svn-id: http://core.svn.wordpress.org/trunk@34718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 22:10:26 +00:00
Dominik Schilling
25b1dd594a Install: Replace the "Privacy" setting with the "Search Engine Visibility" setting from Reading Settings.
Props Clorith, ocean90.
Fixes #27628.
See #16416.
Built from https://develop.svn.wordpress.org/trunk@34752


git-svn-id: http://core.svn.wordpress.org/trunk@34717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 21:35:25 +00:00
Dominik Schilling
18413f3e81 Upgrader: Clear plugin/theme caches directly after a plugin/theme has been installed.
`wp_update_plugins()` and `wp_update_themes()` are both hooked into `upgrader_process_complete` with priority 10. But at this stage the caches in `get_plugins()`, `search_theme_directories()`, and `wp_get_themes()` aren't refreshed yet so both functions couldn't fetch any translations for the new plugin/theme.
To reset the caches `wp_clean_themes_cache()` and `wp_clean_plugins_cache()` are now hooked into `upgrader_process_complete` with priority 9.

Fixes #34029.
Built from https://develop.svn.wordpress.org/trunk@34751


git-svn-id: http://core.svn.wordpress.org/trunk@34716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 21:21:25 +00:00
Jeremy Felt
7c7eee01ef MS: Remove registration of ID column in Sites and Users list tables.
Reverts a portion of [34289] and leaves the render for the column behind. A plugin can register these fields for display via filter.

Fixes #18661.

Built from https://develop.svn.wordpress.org/trunk@34750


git-svn-id: http://core.svn.wordpress.org/trunk@34715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 20:58:24 +00:00
Jeremy Felt
f69396c229 MS: Provide better UI when a main site's /blog prefix is changed.
The main site on a new network is forced by default into using `/blog` as the prefix for its permalink structure. This can be changed easily through the network admin, though the `options-permalink.php` screen is then unusable to make further changes to the structure.

Now, if `/blog/` is not at the beginning of the `permalink_structure` option, we do not force `/blog` as a prefix in the UI.

Fixes #12002.

Built from https://develop.svn.wordpress.org/trunk@34749


git-svn-id: http://core.svn.wordpress.org/trunk@34714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 20:39:24 +00:00
Dominik Schilling
113a9d4517 Language Upgrader: Re-use the automatic upgrader skin if the parent upgrader is using it.
Prevents broken Ajax responses when `Language_Pack_Upgrader::async_upgrade()` gets triggered during a shiny update.

Fixes #34048.
Built from https://develop.svn.wordpress.org/trunk@34748


git-svn-id: http://core.svn.wordpress.org/trunk@34713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 20:25:26 +00:00
Scott Taylor
99347fd96e Shortcodes: Fix PCRE performance bugs in get_shortcode_regexp() and related to wptexturize(), do_shortcode(), and strip_shortcodes()
Alters unit tests.

Props miqrogroove.
Fixes #33517.

Built from https://develop.svn.wordpress.org/trunk@34747


git-svn-id: http://core.svn.wordpress.org/trunk@34712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 18:05:25 +00:00
Drew Jaynes
a985977856 Docs: Update the argument descriptions for $child_of and $hierarchical in get_pages() to more closely reflect expected behavior.
See #18701. See #32246.

Built from https://develop.svn.wordpress.org/trunk@34746


git-svn-id: http://core.svn.wordpress.org/trunk@34711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 17:40:25 +00:00
Scott Taylor
d8179a2a1f Shortcodes: prevent registration of invalid shortcode names.
Adds unit tests.

Props miqrogroove.
Fixes #34090.

Built from https://develop.svn.wordpress.org/trunk@34745


git-svn-id: http://core.svn.wordpress.org/trunk@34710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 17:34:24 +00:00
Scott Taylor
82f244414e Shortcodes: clarify the @return docs for shortcode_parse_atts().
Props miqrogroove.
See #23307.

Built from https://develop.svn.wordpress.org/trunk@34744


git-svn-id: http://core.svn.wordpress.org/trunk@34709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 17:32:26 +00:00
Andrea Fercia
0acededa82 In wp_comment_reply() change the H5 headings in fieldset legends for better accessibility.
Also, add a "Edit Comment" legend before the Quick Edit form to pair it with "Reply to Comment" and "Add new Comment" and move the Name, Email, and URL fields after the Comment textarea.

Props joedolson, afercia.

Fixes #33757.
Built from https://develop.svn.wordpress.org/trunk@34743


git-svn-id: http://core.svn.wordpress.org/trunk@34708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 14:52:25 +00:00
Andrea Fercia
5a2627d38a Bump H3 headings to H2 on the Network Site Users screen for better accessibility.
Fixes #34081.
Built from https://develop.svn.wordpress.org/trunk@34742


git-svn-id: http://core.svn.wordpress.org/trunk@34707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 14:33:26 +00:00
Boone Gorges
8be90670f3 Make sure permastruct is set in comments_template() tests.
After [34735].
Built from https://develop.svn.wordpress.org/trunk@34741


git-svn-id: http://core.svn.wordpress.org/trunk@34706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 12:27:29 +00:00
Dion Hulse
868fc06fd4 Update Akismet external to 3.1.4 in trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@34705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 11:23:47 +00:00
Dion Hulse
dc9203d753 Rewrite insert_with_markers() to use flock() when available, significant cleanup of the function too.
The call to `flock()` is an exclusive advisory lock, which in my testing only PHP respects (apache continues to read it).
Not all filesystems support locking (remote NFS mounts for example) so this offers minimal benefit to those platforms, but offers much better protection against file corruption on systems which do support it.
The call is blocking, so a second process will wait for the first to complete before writing if supported.

See #31767

Built from https://develop.svn.wordpress.org/trunk@34740


git-svn-id: http://core.svn.wordpress.org/trunk@34704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 07:46:27 +00:00
Dion Hulse
a4c41f6ee4 Updates: SSH2 Transport: Add a connection error when the SFTP subsystem cannot be initialized.
Fixes #33478

Built from https://develop.svn.wordpress.org/trunk@34739


git-svn-id: http://core.svn.wordpress.org/trunk@34703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:43:25 +00:00
Dion Hulse
d8aaf01b97 Updates: SSH2 Transport: Use a work around to avoid a bug where PHP's SSH2 extension fails to list the contents of the / directory.
This fixes issues where SSH2 with chrooted environments runs into a `Unable to locate WordPress Content directory (wp-content).` error.

The workaround is to simply list the contents of the `/./` directory instead of `/`.

Fixes #33919

Built from https://develop.svn.wordpress.org/trunk@34738


git-svn-id: http://core.svn.wordpress.org/trunk@34702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:40:25 +00:00
Gary Pendergast
3942226c90 WPDB: Allow null values in the CRUD functions.
Specifically, `::insert()`, `::replace()`, `::update()`, and `::delete()` can now set a column to `NULL`, or add the `IS NULL` condition to the `WHERE` clause.

This is based on [backpress 279].

Props pento, nbachiyski, sorich87.

Fixes #15158.


Built from https://develop.svn.wordpress.org/trunk@34737


git-svn-id: http://core.svn.wordpress.org/trunk@34701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:37:26 +00:00
Dion Hulse
9caa7c4ba7 Press This: Make the regular expressions for matching images easier to read by not requiring escaping.
Fixes #32878

Built from https://develop.svn.wordpress.org/trunk@34736


git-svn-id: http://core.svn.wordpress.org/trunk@34700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:16:25 +00:00
Boone Gorges
b23fdba5a2 Ensure that comment permalinks reflect pagination.
After [34561], `wp_list_comments()` no longer passed all of a post's comments
to `Walker_Comments`. As a result, calls to `get_comment_link()` occurring
inside the comment loop had insufficient context to determine the proper
'cpage' value to use when generating comment permalinks. This, in turn, caused
comment permalinks to behave erratically.

The current changeset addresses the problem as follows:

* `get_comment_link()` now accepts a 'cpage' parameter. When present, 'cpage' will be used to build the comment permalink - no automatic calculation will take place.
* When called within the main loop, `wp_list_comments()` calculates the proper 'cpage' value for comments in the loop, and passes it down to `get_comment_link()`.
* `cpage` and `comment-page-x` query vars are generally required in comment permalinks (see #34068), but an exception is made when 'default_comment_page=oldest': the bare post permalink will always be the same as `cpage=1`, so `cpage` is excluded in this case.

Props peterwilsoncc for assiduous spreadsheeting.
Fixes #34073.
Built from https://develop.svn.wordpress.org/trunk@34735


git-svn-id: http://core.svn.wordpress.org/trunk@34699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:13:25 +00:00
Scott Taylor
b97dd529fa Canonical: remove unused code (commented-out) from redirect_canonical().
Props hakre, chriscct7.
Fixes #16934.

Built from https://develop.svn.wordpress.org/trunk@34734


git-svn-id: http://core.svn.wordpress.org/trunk@34698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:09:50 +00:00
Dion Hulse
731b51ee7f Updates: Try a more compatible method to detect if a file exists when using the FTP Extension.
This change causes it to list the parent directories files, and assets that the node exists within the returned listing, this is a little more compatible than relying upon the FTP server to correctly filter the returned resultset to the specific file/node being requested.
Fixes #28013

Built from https://develop.svn.wordpress.org/trunk@34733


git-svn-id: http://core.svn.wordpress.org/trunk@34697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:09:25 +00:00
Boone Gorges
51ddf2ca9c Correct some WP_Query metadata lazyloading docs.
Props dlh.
Fixes #34047.
Built from https://develop.svn.wordpress.org/trunk@34732


git-svn-id: http://core.svn.wordpress.org/trunk@34696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 04:01:48 +00:00
Boone Gorges
80654eb17a s/add_action()/add_filter() in WP_Query metadata lazyloading.
Props dlh.
See #34047.
Built from https://develop.svn.wordpress.org/trunk@34731


git-svn-id: http://core.svn.wordpress.org/trunk@34695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 04:01:24 +00:00
Boone Gorges
b2f253fc8e Prevent extra db queries in WP_Comment::get_children().
`WP_Comment_Query::fill_descendants()` queries for a comment tree in a way that
minimizes database overhead, and places the located descendants with their
proper parents. However, it doesn't touch leaf nodes - comments with no
children - so future calls to `get_children()` on those comment objects
result in unnecessary database queries. To prevent this, `fill_descendants()`
now sets a `populated_children` flag on all located `WP_Comment` objects.

See #8071.
Built from https://develop.svn.wordpress.org/trunk@34730


git-svn-id: http://core.svn.wordpress.org/trunk@34694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 03:58:23 +00:00
Boone Gorges
dd9709d179 Simplify pagination logic in comments_template().
[34561] "fixed" the problem of newest-first comments showing fewer than
'per_page' comments on the post permalink when the total number of comments
was not divisible by 'per_page'. See #29462. But this fix caused numerous
other problems. First, comment pages reported by `get_page_of_comment()`
(which expects comment pages to be filled oldest-first) were no longer correct.
Second, and more seriously, the new logic caused comments to be shifted
between pages, making their permalinks non-permanent.

The current changeset reverts the changed behavior. In order to preserve the
performance improvements introduced in [34561], an additional query must be
performed when 'default_comments_page=newest' and 'cpage=0' (ie, you're viewing
the post permalink). A nice side effect of this revert is that we no longer
need the hacks required to determine proper comment pagination, introduced in
[34561].

See #8071. See #34073.
Built from https://develop.svn.wordpress.org/trunk@34729


git-svn-id: http://core.svn.wordpress.org/trunk@34693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 03:11:30 +00:00
Scott Taylor
594a208753 Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.
Add 2 methods to `WP_List_Table`, `->get_orderby()` and `->get_order()`. Override the methods in `WP_Posts_List_Table`.

`WP_Posts_List_Table` calls `wp_edit_posts_query()` in `->prepare_items()` which is a wrapper for `wp()`. As such, we can obtain `orderby` and `order` via `get_query_var()`, instead of the URL.

Fixes #25493.


Built from https://develop.svn.wordpress.org/trunk@34728


git-svn-id: http://core.svn.wordpress.org/trunk@34692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 02:10:25 +00:00
Drew Jaynes
ec9ec3138e Formatting: Rename the $richedit parameter in format_to_edit() to $rich_text.
Previously, it was necessary to explain in a double-negative that `$richedit` being false would prevent `$content` from being passed through `esc_textarea()`. The updated `$rich_edit` name and documentation now better reflects the intent of the parameter.

Fixes #21613.

Built from https://develop.svn.wordpress.org/trunk@34727


git-svn-id: http://core.svn.wordpress.org/trunk@34691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 02:01:26 +00:00
Helen Hou-Sandí
1bacb00c01 Comments: Trash blacklisted comments by default.
If trash is disabled, they wil continue to go into spam like they do now.

props wonderboymusic, solarissmoke, MikeHansenMe.
fixes #7051.

Built from https://develop.svn.wordpress.org/trunk@34726


git-svn-id: http://core.svn.wordpress.org/trunk@34690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 01:49:25 +00:00
Drew Jaynes
3d6f53da06 Docs: Document declaration of the $submenu_file global in wp-admin/menu-header.php.
See #24531. See #32246.

Built from https://develop.svn.wordpress.org/trunk@34725


git-svn-id: http://core.svn.wordpress.org/trunk@34689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 01:48:25 +00:00
Drew Jaynes
2a0a841a13 Declare the $submenu_file global to avoid a notice generated by passing it as a parameter to the submenu_file hook, introduced in [34722].
Fixes #24531.

Built from https://develop.svn.wordpress.org/trunk@34724


git-svn-id: http://core.svn.wordpress.org/trunk@34688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 01:23:25 +00:00
Helen Hou-Sandí
7365e0ebbb Don't show the "Add New" link on post-new.php.
Using the same `$post_new_file` global variable name in `wp-admin/menu.php` in [33723] was unintentional, but we're already unsetting other variables that are in global scope so we can just unset this one as well. Someday the admin menu won't be a big pile of sad and cryptic globals. Maybe.

props johnjamesjacoby, norcross.
fixes #34045.

Built from https://develop.svn.wordpress.org/trunk@34723


git-svn-id: http://core.svn.wordpress.org/trunk@34687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 00:48:25 +00:00
Sergey Biryukov
145deeeada Add 'submenu_file' filter for the file of an admin menu sub-menu item.
This complements the `'parent_file'` filter added in [12712].

Props swissspidy, kraftbj.
Fixes #24531.
Built from https://develop.svn.wordpress.org/trunk@34722


git-svn-id: http://core.svn.wordpress.org/trunk@34686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 00:23:28 +00:00
Weston Ruter
35631aeeeb Customize: Style the nav menu "Add Items" button as disabled when reordering.
Fixes CSS selector to match what is being used for the "Add Widget" button in the customizer.

Props umesh.nevase.
Fixes #34102.

Built from https://develop.svn.wordpress.org/trunk@34721


git-svn-id: http://core.svn.wordpress.org/trunk@34685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 22:55:26 +00:00
Boone Gorges
d6a1a9655c Fix db_version juggling during non-multisite tests.
Continuing with the "code is poetry" theme after [34719], we need to continue
to update the option in the database on non-multisite in this
`wp_insert_term()` test.

See #31130.
Built from https://develop.svn.wordpress.org/trunk@34720


git-svn-id: http://core.svn.wordpress.org/trunk@34684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 13:28:26 +00:00
Boone Gorges
a09e95214a Prevent Multisite term tests from hitting database for 'db_version'.
[34718] introduced a 'db_version' check to term meta functions, to ensure that
they don't run when the term meta schema is not yet in place. This call to
`get_option()` causes a database hit during Multisite tests, due to the
presence of the `WP_INSTALLING` constant. See #31130. The extra database
queries are causing cache tests to fail.

In similar cases, we have `markTestSkipped()` when `is_multisite()`. Because
the term meta API is so extensive - term meta caches can be primed anywhere a
`WP_Query` loop is fired up - we implement a more generous workaround in this
case. To prevent `get_option( 'db_version' )` from hitting the database during
multisite unit tests, we use a 'pre_option_' filter.

Heaven help us.

See #34091.
Built from https://develop.svn.wordpress.org/trunk@34719


git-svn-id: http://core.svn.wordpress.org/trunk@34683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 13:09:27 +00:00
Boone Gorges
dac1de24f7 Bail out of termmeta functions if schema is not up-to-date.
Termmeta cache priming was throwing database errors on installations that had
not yet gone through the database update routine. To avoid errors in all cases,
the check has been added to all termmeta functions. These checks will be
removed in a future version of WordPress. (Hang on to your hats!)

Fixes #34091.
Built from https://develop.svn.wordpress.org/trunk@34718


git-svn-id: http://core.svn.wordpress.org/trunk@34682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 04:53:25 +00:00