Commit Graph

440 Commits

Author SHA1 Message Date
Sergey Biryukov
61a2f62ffd Comments: Use comment instead of an empty string for the comment_type DB field value in comments table.
This is the first step to bring support for custom comment types into WordPress.

Add a scheduled upgrade routine to update the type value for existing comments, in batches of 100 at a time.

Props imath, aaroncampbell, jeremyfelt, dshanske.
Fixes #49236.
Built from https://develop.svn.wordpress.org/trunk@47597


git-svn-id: http://core.svn.wordpress.org/trunk@47372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-17 19:35:06 +00:00
Sergey Biryukov
38676936ba Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov
63ed0401a0 Privacy: Revert [47269] for now to address side effects on Multisite installations.
See #44176.
Built from https://develop.svn.wordpress.org/trunk@47280


git-svn-id: http://core.svn.wordpress.org/trunk@47080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-11 21:48:06 +00:00
Sergey Biryukov
30c7bb621c Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:
* `erase_others_personal_data`
* `export_others_personal_data`
* `manage_privacy_options`

Previously mapped to `manage_options` or `manage_network` (on Multisite), these are now added to the Administrator role separately.

Additionally, `manage_privacy_options` is added to the Editor role.

Props garrett-eclipse, xkon, pbiron, desrosj, johnbillion, flixos90, juliobox, lakenh, Ov3rfly, ianatkins.
Fixes #44176.
Built from https://develop.svn.wordpress.org/trunk@47269


git-svn-id: http://core.svn.wordpress.org/trunk@47069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-11 18:36:06 +00:00
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
47ed56f38f Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
dd4d98a368 Docs: In various @return tags, list the expected type first, instead of false.
Follow-up to [46696].

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47060


git-svn-id: http://core.svn.wordpress.org/trunk@46860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-11 18:32:05 +00:00
Sergey Biryukov
4edec193bc Users: When creating the first user on installation, populate the Website profile field with the site URL.
Skip setting the field if the user already exists, which is the case when the user tables are being shared among multiple sites.

Props EFAREM, eclare, darrenlambert, zachflauaus, viralsampat.
Fixes #35778.
Built from https://develop.svn.wordpress.org/trunk@46989


git-svn-id: http://core.svn.wordpress.org/trunk@46789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-18 02:26:03 +00:00
Sergey Biryukov
bbd898b1dd Upgrade/Install: Remove unused global in upgrade_430_fix_comments().
Props adnan.limdi.
Fixes #41970.
Built from https://develop.svn.wordpress.org/trunk@46972


git-svn-id: http://core.svn.wordpress.org/trunk@46772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-17 16:45:03 +00:00
John Blackbourn
eda6a9e111 Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.
See #48303

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


git-svn-id: http://core.svn.wordpress.org/trunk@46462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-05 21:30:03 +00:00
desrosj
894e133d0c Build/Test Tools: Introduce automated PHP compatibility checking.
This change introduces a new Composer script, `compat` that will scan the codebase for (detectable) potential PHP compatibility issues using the `PHP_CodeSniffer` and a custom ruleset based off of the `PHPCompayibilityWP` ruleset (`phpcompat.xml.dist`).

The command will be run as a separate job within each Travis build. While many compatibility issues and false positives have already been corrected in this commit and other Trac tickets, there are still some remaining. For that reason, the job is allowed to fail while the remainder of the potential compatibility issues are investigated and addressed. After those are resolved, the job should be set as required to pass to help prevent new compatibility issues from being introduced.

Props desrosj, jrf, all PHPCompatibilityWP and PHPCompatibility contributors.
Fixes #46152.
Built from https://develop.svn.wordpress.org/trunk@46290


git-svn-id: http://core.svn.wordpress.org/trunk@46102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-25 13:47:58 +00:00
Sergey Biryukov
a943fd64bc Coding Standards: Fix WPCS issue in [46283].
See #48110.
Built from https://develop.svn.wordpress.org/trunk@46284


git-svn-id: http://core.svn.wordpress.org/trunk@46096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-23 23:24:57 +00:00
Sergey Biryukov
75ca249558 Twenty Twenty: Rename widget areas to sidebar-1 and sidebar-2.
This ensures that widgets are mapped correctly and is consistent with the previous default themes.

See https://github.com/WordPress/twentytwenty/issues/481.

Reverts [46282].

Props ocean90, garrett-eclipse, desrosj, SergeyBiryukov.
See #48110.
Built from https://develop.svn.wordpress.org/trunk@46283


git-svn-id: http://core.svn.wordpress.org/trunk@46095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-23 23:17:58 +00:00
desrosj
098455b06f Bundled Themes: Make Twenty Twenty the new default theme.
After being imported in [46271], Twenty Twenty can now be set as the default theme in WordPress.

See #48110.
Props desrosj, ocean90.
Built from https://develop.svn.wordpress.org/trunk@46278


git-svn-id: http://core.svn.wordpress.org/trunk@46090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-23 21:00:58 +00:00
whyisjake
a014bd21c1 Multisite: Remove the redundant blog_versions table.
As part of the Multisite installation process, a `blog_versions` table is created. This table is never read from (except immediately prior to updating it), it's only ever inserted into or updated. It is not used to determine which blogs need to be upgraded.
This table was introduced in 3.0 when the WPMU schema was merged #11644 and it appears the table has never been used in core and is therefore redundant and may as well be removed.

Props johnbillion, nacin, ryan, johnjamesjacoby, whyisjake.

Fixes #19755. See #41685.


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


git-svn-id: http://core.svn.wordpress.org/trunk@46006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-19 22:07:57 +00:00
whyisjake
250eb42802 Networks and Sites: Save database version in site meta (Multisite)
Currently there is there a table in multisite called blog_versions. All this table stores is the database version as number and the date updated. With plans to add site meta in #37923 this new table should be used. This has a number of benefits, including functions to CRUD these values in the database. Once this data is in the blogmeta, table, the blog_versions table can be removed all together. If require a SQL view can be used blog_versions from data stored in blogmeta.

Props spacedmonkey, leogermani.

Fixes #41685. See #19755.


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


git-svn-id: http://core.svn.wordpress.org/trunk@46005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-19 21:42:58 +00:00
desrosj
5329411f6d General: Ensure the arguments passed to implode() are in the correct order.
The `implode()` function accepts two. parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

This change fixes the occurrences of reversed arguments in Core with the exception of those contained in included external libraries. These will be handled separately.

Props jrf, jorbin.
See #47746.
Built from https://develop.svn.wordpress.org/trunk@46155


git-svn-id: http://core.svn.wordpress.org/trunk@45967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-17 13:40:57 +00:00
Sergey Biryukov
3591f1ad60 Text Changes: Correct "up-to-date" vs. "up to date" usage in a database update string and inline comments.
* "Up to date" is an adverb phrase that describes an action that brings something in line with the latest information.
* "Up-to-date" is an adjective phrase that is used as a synonym for "current".

Props socalchristina, hareesh-pillai, garrett-eclipse, desrosj, aprea.
Fixes #38998.
Built from https://develop.svn.wordpress.org/trunk@46096


git-svn-id: http://core.svn.wordpress.org/trunk@45908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 13:06:57 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Andrew Ozz
400ed5add0 Remove trailing white space in upgrade.php.
See #46349.
Built from https://develop.svn.wordpress.org/trunk@45789


git-svn-id: http://core.svn.wordpress.org/trunk@45600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-13 19:53:55 +00:00
Andrew Ozz
197b4a829b Admin email verification:
- Add the `admin_email_lifespan` option when installing. Fixes a bug where the verification screen is shown right after installation.
- Reset the same option when upgrading and the user doing the DB upgrade is not an admin. This will ensure the email verification is shown next time an admin logs in.
- Use `site_url()` instead of `network_site_url()` for the form action. The latter seems needed only for password reset.

See #46349.
Built from https://develop.svn.wordpress.org/trunk@45788


git-svn-id: http://core.svn.wordpress.org/trunk@45599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-13 17:40:55 +00:00
Andrew Ozz
52c53ae6f8 Remove trailing white space in upgrade.php after [45757].
See #46349.
Built from https://develop.svn.wordpress.org/trunk@45758


git-svn-id: http://core.svn.wordpress.org/trunk@45569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-07 01:01:57 +00:00
Andrew Ozz
fff56d219f Add admin email verification screen. Shown every six months after an admin has logged in.
Also includes WPCS fixes for wp-login.php.

Props andraganescu, boemedia, lessbloat, azaozz.
See #46349.
Built from https://develop.svn.wordpress.org/trunk@45757


git-svn-id: http://core.svn.wordpress.org/trunk@45568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-07 00:04:56 +00:00
Sergey Biryukov
f7b8423b12 Upgrade/Install: Make sure translate_level_to_role() always returns a value.
Props diddledan.
Fixes #46848.
Built from https://develop.svn.wordpress.org/trunk@45747


git-svn-id: http://core.svn.wordpress.org/trunk@45558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-05 07:48:58 +00:00
Sergey Biryukov
b1e34ccc1f Docs: Add missing description for $wp_rewrite global.
See #45604, #47110.
Built from https://develop.svn.wordpress.org/trunk@45735


git-svn-id: http://core.svn.wordpress.org/trunk@45546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 01:19:56 +00:00
Sergey Biryukov
29b072e706 Docs: Add missing description for $wpdb, $wp_db_version, and $wp_current_db_version globals.
Props mukesh27, utsav72640, immeet94, SergeyBiryukov.
See #45604.
Built from https://develop.svn.wordpress.org/trunk@45734


git-svn-id: http://core.svn.wordpress.org/trunk@45545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 01:12:56 +00:00
Gary Pendergast
abcbee954f Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-09 05:45:58 +00:00
Gary Pendergast
87675d288b Coding Standards: Fix all WordPress.WhiteSpace.PrecisionAlignment issues.
See #47632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-05 05:21:56 +00:00
Gary Pendergast
cf3fa9f7c8 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 12:52:01 +00:00
Gary Pendergast
55af0f0d0a Coding Standards: Fix/ignore the WordPress.NamingConventions.ValidFunctionName violations.
See #47632


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


git-svn-id: http://core.svn.wordpress.org/trunk@45391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 08:01:57 +00:00
Andrew Ozz
87acdab81d Privacy tools: Organize privacy functions into logical files and classes.
Props xkon, birgire, desrosj, garrett-eclipse, azaozz.
See #43895.
Built from https://develop.svn.wordpress.org/trunk@45448


git-svn-id: http://core.svn.wordpress.org/trunk@45259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 20:50:53 +00:00
Sergey Biryukov
c77e771c84 Date/Time: Replace all instances of date() with gmdate().
Use of `date()` in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed).

`gmdate()` is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs.

Props nielsdeblaauw, Rarst.
Fixes #46438. See #44491.
Built from https://develop.svn.wordpress.org/trunk@45424


git-svn-id: http://core.svn.wordpress.org/trunk@45235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 00:12:54 +00:00
Sergey Biryukov
b2e3f517e1 Database: Use wp_die() instead of die() in wp_check_mysql_version(), for more flexibility and consistency with other error messages in core.
Props spacedmonkey.
Fixes #45975.
Built from https://develop.svn.wordpress.org/trunk@45030


git-svn-id: http://core.svn.wordpress.org/trunk@44839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 14:03:51 +00:00
Peter Wilson
c4505be534 Install/upgrade: Remove Gutenberg plugin deactivation from upgrade process.
The Gutenberg plugin will not be deactivated on sites upgrading to WordPress 5.1. This deprecates the `upgrade_500_was_gutenberg_active` option and the `upgrade_500()` function as they are no longer required.

Props peterwilsoncc.
Fixes #46029.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-08 00:16:50 +00:00
Gary Pendergast
6d5cd6842a Coding Standards: Document intentional case block fall-throughs.
Fixes `PSR2.ControlStructures.SwitchDeclaration.TerminatingComment` violations.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:26:50 +00:00
Felix Arntz
035877708d Multisite: Update @since tags for site meta introduction.
Fixes #37923. Fixes #40229.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 08:18:50 +00:00
Gary Pendergast
363cfc4301 General: Replace "Happy blogging" with "Happy publishing".
As of this commit, WordPress is no longer a simple blogging platform. It's now a comprehensive publishing solution.

This also replaces a couple of other "blog" references that were missed previously.

Props igmoweb, Valer1e, audrasjb, pento.
Fixes #41000.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 04:30:50 +00:00
desrosj
9cd64e1341 Help/About: WordPress 5.0 About Page.
The About page describes all the great changes in WordPress 5.0.

Highlights:

- Warn users of Gutenberg plugin of its deactivation upon 5.0 upgrade.
- Added illustrations to the Four Freedoms page.
- Include a link to wporg user’s plugin favorites as a way to display only the classic plugin as a suggestion for install.
- Detail the Classic Editor plugin and the support timeline.

Props pixelverbieger, ocean90, karmatosed, pento, boemedia, lonelyvegan, sami.keijonen, TimothyBlynJacobs, xkon, afercia, laurelfulford, joostdevalk, ipstenu, matveb, joen, tinkerbelly, chanthaboune, kjellr, alexislloyd, melchoyce, mcsf, courtney0burton, Otto42, cathibosco, tobifjellner, helen, audrasjb, antpb, jjj, elrae, desrosj, azaozz, joemcgill, skithund, gziolo.

Merges [43913], [43921-43922], [43937-43938], [43946-43947], [43952-43953], [43967-43969] into trunk.

Fixes #45178.
Built from https://develop.svn.wordpress.org/trunk@44264


git-svn-id: http://core.svn.wordpress.org/trunk@44094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:36:59 +00:00
Gary Pendergast
4739b8147b Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:43:52 +00:00
Gary Pendergast
5e62e6b203 Bundled Themes: Make twentynineteen the default theme.
After [44149], we can now make twentynineteen the default theme. Twentyseventeen has been a great default, but 5.0 and twentynineteen is guten.

Merges [43809,43954] from the 5.0 branch to trunk.

Fixes #45152.
Props jorbin, SergeyBiryukov, pento, mcsf.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 02:49:38 +00:00
desrosj
e125a29326 Upgrade/Install: Deactivate Gutenberg plugin on update to 5.0.
Props mcsf.

Merges [43765] to trunk.

Fixes #45123.
Built from https://develop.svn.wordpress.org/trunk@44125


git-svn-id: http://core.svn.wordpress.org/trunk@43955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 22:27:04 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Andrew Ozz
1b1cc0b371 Privacy: make creating a privacy policy page on install multisite compatible.
See #43491.
Built from https://develop.svn.wordpress.org/trunk@43243


git-svn-id: http://core.svn.wordpress.org/trunk@43072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-11 15:44:21 +00:00
Andrew Ozz
280aeff5d2 Fix typo (missing !).
See #43491.
Built from https://develop.svn.wordpress.org/trunk@42982


git-svn-id: http://core.svn.wordpress.org/trunk@42811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-16 10:14:21 +00:00
Andrew Ozz
f1e065b13b Privacy: automatically create a Privacy Policy page when installing WordPress.
Props fclaussen, azaozz.

Fixes #43491.
Built from https://develop.svn.wordpress.org/trunk@42981


git-svn-id: http://core.svn.wordpress.org/trunk@42810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-16 09:00:20 +00:00
John Blackbourn
b13e73d05c Docs: Document more parameters and properties using typed array notation.
See #41756

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


git-svn-id: http://core.svn.wordpress.org/trunk@42705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-25 18:10:32 +00:00
Felix Arntz
176a289050 Multisite: Introduce metadata for sites.
A new global multisite table `wp_blogmeta` is added to the database schema, and a set of `*_site_meta()` API functions are introduced.

The implementation fails gracefully when the new table is not yet available, which may happen especially shortly after the core update, before the network has been upgraded to the new database schema. The presence of the table is detected once and stored as a global setting on the main network.

Core does not yet use site metadata, but there are several use-cases to be implemented or explored in the near future, and it allows plugins to extend sites with arbitrary data, which will come in particularly handy with the upcoming REST API endpoint for sites.

Props spacedmonkey, johnjamesjacoby, jeremyfelt, flixos90.
Fixes #37923.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-16 02:15:31 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Gary Pendergast
882db52bdd General: Add inline PHPCS options to leave regex indentation.
We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the `Squiz.Strings.ConcatenationSpacing.PaddingFound` rule for these blocks stops the extra whitespace from being removed.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-28 04:24:57 +00:00
Gary Pendergast
c90cfa3b50 General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Felix Arntz
d14a2988e7 Multisite: Fix broken update blog_versions query after [41661].
Props Mista-Flo, lenasterg.
Fixes #42641.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-20 23:46:48 +00:00
Dion Hulse
26f9c6b909 Transients: Clear expired transients from the database in a daily cron task.
Fixes #41699

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


git-svn-id: http://core.svn.wordpress.org/trunk@41797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-21 13:22:49 +00:00
Felix Arntz
1130241bbd Multisite: Replace calls to refresh_blog_details() with clean_blog_cache().
Fixes #42077. See #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:05:46 +00:00
Jeremy Felt
abdfe59c28 Multisite: Use get_current_blog_id() instead of $wpdb->blogid.
`get_current_blog_id()` is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global `$wpdb` in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 01:44:47 +00:00
John Blackbourn
28eda6f4bc General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620

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


git-svn-id: http://core.svn.wordpress.org/trunk@41129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-22 11:52:48 +00:00
Dominik Schilling
0e82284d87 Multisite: Revert indentation of the sample page content added in [40296].
Props swissspidy.
Fixes #40895.
Built from https://develop.svn.wordpress.org/trunk@40864


git-svn-id: http://core.svn.wordpress.org/trunk@40714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-01 09:16:40 +00:00
Sergey Biryukov
2c5e9a34b2 Dashboard: Change the cache key for dashboard RSS widget; remove the unnecessary database upgrade routine.
Props iandunn, ocean90.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40803


git-svn-id: http://core.svn.wordpress.org/trunk@40661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 19:14:42 +00:00
Konstantin Obenland
71adf97a35 Upgrade: Use correct commit no. to trigger upgrade
Props iandunn.
See [40607], #40702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-17 22:03:46 +00:00
Andrew Ozz
b952bf4eae Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.
Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40607


git-svn-id: http://core.svn.wordpress.org/trunk@40477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 20:04:42 +00:00
Pascal Birchler
62061bab56 Multisite: Ensure first page/post/comment content is not empty when setting up a new site.
This prevents creating page without any content when the options are populated with an empty string.

Props shadyvb.
Fixes #40036.
Built from https://develop.svn.wordpress.org/trunk@40296


git-svn-id: http://core.svn.wordpress.org/trunk@40203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-17 15:49:42 +00:00
Gary Pendergast
096b09d941 dbDelta: Ignore index subparts when checking for duplicate indices.
If index lengths change in table definitions, we don't recreate the index - instead, we throw a database error, as `dbDelta()` tries to create a new index with the same name.

It's better to leave the index as is, MySQL doesn't have an efficient process for resizing indices, and dropping/creating is a slow process which we don't want to trigger automatically.

Fixes #34870.


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


git-svn-id: http://core.svn.wordpress.org/trunk@39858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-17 04:01:42 +00:00
Sergey Biryukov
fdc2b34124 Docs: Move install_global_terms() DocBlock after the function_exists() call.
Props keesiemeijer.
Fixes #39526.
Built from https://develop.svn.wordpress.org/trunk@39754


git-svn-id: http://core.svn.wordpress.org/trunk@39692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-09 14:31:44 +00:00
John Blackbourn
4cf5550d8d I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.
Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882

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


git-svn-id: http://core.svn.wordpress.org/trunk@39263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-21 01:22:32 +00:00
Helen Hou-Sandí
2d07c3196e Only set fresh_site during an actual fresh install.
props westonruter.
fixes #38533.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:16:31 +00:00
Dominik Schilling
652742bf0a Install: Update sidebars_widgets option for Twenty Seventeen to match its three sidebars.
See #38372.
Built from https://develop.svn.wordpress.org/trunk@38919


git-svn-id: http://core.svn.wordpress.org/trunk@38862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:01:13 +00:00
Dion Hulse
e8211f783a Docs: Correct a number of typos/spelling mistakes in inline comments.
Props ottok.
Fixes #38464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 00:38:35 +00:00
Jeremy Felt
1560fbcbc5 Multisite: Use get_network() and get_current_network_id() for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:47:30 +00:00
Gary Pendergast
a18b133c01 Database: Normalise index names in dbDelta().
When comparing index definitions, normalise the index names to lower case, as they are not case sensitive within MySQL.

Fixes #34874.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-12 05:09:30 +00:00
Sergey Biryukov
6c7a60ffb4 Permalinks: In wp_install_maybe_enable_pretty_permalinks():
* Use `get_page_by_path()` instead of a hardcoded ID, which may not always exist.
* Remove the "test against a random 404 page" part, which is no longer relevant after [34442].

Fixes #36628.
Built from https://develop.svn.wordpress.org/trunk@38109


git-svn-id: http://core.svn.wordpress.org/trunk@38050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-19 23:12:32 +00:00
Sergey Biryukov
139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong(), _deprecated_function(), _deprecated_argument(), and _deprecated_file() throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Dominik Schilling
4594006ca6 Plugins: Clean up uninstall_plugins option during database upgrade.
`register_uninstall_hook()` is designed to be given a function callback (or a static class variable), not an array/object instance. This got blocked in [16339] but the option itself was never cleaned up.

Props polevaultweb.
Fixes #31625.
Built from https://develop.svn.wordpress.org/trunk@37965


git-svn-id: http://core.svn.wordpress.org/trunk@37906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-05 13:28:29 +00:00
Pascal Birchler
a5580012a3 Docs: Fix a typo across some function and hook docs.
s/filterss/filters.

See #32246.
Built from https://develop.svn.wordpress.org/trunk@37961


git-svn-id: http://core.svn.wordpress.org/trunk@37902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-04 22:45:29 +00:00
Aaron Jorbin
f7465bfcf3 Comments: Further improve text of initial comment.
In [37888], the comment text was initially updated, however an opportunity to make the text less trivializing of actions that users will take was missed. To quote Helen Hou-Sandi: "It's important not to trivialize actions that are perfectly reasonable for a user to find tricky (where to go to log in is not exactly intuitive, even with the rewrites we have now)."

The text of the comment now reads:

> Hi, this is a comment.
> To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
> Commenter avatars come from <a href="https://gravatar.com">Gravatar</a>.

Some interesting reading on the topic of "Simple" and "Easy" and how they relate to software development can be found at http://andrewspittle.com/2012/01/31/avoiding-easy/ and written by andrewspittle.

Props helen.
Fixes #36702.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 20:50:27 +00:00
Dominik Schilling
4b9a726c5a Comments: Improve author and content of the default comment.
The new comment:

> A WordPress Commenter <!wapuu@wordpress.example>:
>
> Hi, this is a comment.
> To moderate comments, just log in. There you will have the option to edit or delete them.
> Commenter avatars come from <a href="!https://gravatar.com">Gravatar</a>.

Also introduces a network setting to set the email address of the first comment author on a new site.

Props Ipstenu, rachelbaker, jorbin, jeremyfelt.
Fixes #36702, #14268.
Built from https://develop.svn.wordpress.org/trunk@37888


git-svn-id: http://core.svn.wordpress.org/trunk@37829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 10:03:27 +00:00
Jeremy Felt
6f3f00ea97 Multisite: Change WP_Network id property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26:29 +00:00
Dominik Schilling
2f998cac7f Database: Normalize index definitions in dbDelta().
`dbDelta()` compares the index definitions against the result of `SHOW INDEX FROM $table_name`. This requires a specific format so indices are not unnecessarily re-created. This format wasn't ensured, until now.

* Parse the raw index definition to extract the type, name and columns so a normalized definition can be built (#20263, #34873).
* Standardize on uppercase types (#34871) and on 'KEY'. 'INDEX' is only a synonym for 'KEY'.
* Escape index names with backticks (#20263).
* Normalize columns: Ignore ASC and DESC definitions (#34959), remove whitespaces (#34869) and escape column names with backticks (#20263).
* Add backticks to all index change queries (#20263).

Props ocean90, pento, kurtpayne.
Fixes #20263, #34869, #34871, #34873, #34959.
Built from https://develop.svn.wordpress.org/trunk@37583


git-svn-id: http://core.svn.wordpress.org/trunk@37551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-27 11:57:30 +00:00
Gary Pendergast
0db17129a5 Database: Add support for SPATIAL keys to dbDelta().
`dbDelta()` already supported spatial fields (by virtue of not checking field types), so it's nice to round that out with spatial key support, too.

Fixes #36948.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-26 04:59:27 +00:00
Dominik Schilling
a5b8dca864 Database: Support backticks around field names when parsing a query for the field type.
Avoids an undefined index PHP warning by `dbDelta()`.

Props davidmosterd, ocean90.
See #20263.
Built from https://develop.svn.wordpress.org/trunk@37538


git-svn-id: http://core.svn.wordpress.org/trunk@37506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 18:12:28 +00:00
Dominik Schilling
00487d5762 Database: Remove debug comments in dbDelta().
Built from https://develop.svn.wordpress.org/trunk@37533


git-svn-id: http://core.svn.wordpress.org/trunk@37501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 15:04:28 +00:00
Dominik Schilling
e5a87afb29 Database: Reduce the number of strtolower() calls in dbDelta().
Fixes #36919.
Built from https://develop.svn.wordpress.org/trunk@37532


git-svn-id: http://core.svn.wordpress.org/trunk@37500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 14:58:27 +00:00
Gary Pendergast
18ca26574b Database: dbDelta() will no longer try to downgrade the size of TEXT and BLOB columns.
When upgrading to `utf8mb4`, `TEXT` fields will be upgraded to `MEDIUMTEXT` (and likewise for all other `*TEXT` and `*BLOB` fields). This is to allow for the additional space requirements of `utf8mb4`.

On the subsequent upgrade, after the `utf8mb4` upgrade, `dbDelta()` would try and downgrade the fields to their original size again. At best, this it a waste of time, at worst, this could truncate any data larger than the original size. There's no harm in leaving them at their original size, so let's do that.

Fixes #36748.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 08:36:28 +00:00
Drew Jaynes
c3055cc190 Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:01:30 +00:00
Andrew Ozz
13c885bdce TinyMCE, inline link:
- Remove unused user setting for wpLink.
- Remove redundant text and variable from wp_link_dialog().

Props afercia, azaozz.
See #33301.
Built from https://develop.svn.wordpress.org/trunk@36985


git-svn-id: http://core.svn.wordpress.org/trunk@36952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-14 01:39:26 +00:00
Drew Jaynes
56fb3cc08d Docs: Improve documentation for upgrade_450(), introduced in [36180].
See #27772, #35323. See #35986.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-03 09:01:26 +00:00
Dominik Schilling
c38daf6a7e Upgrade: Bump db version for upgrade_450() in upgrade_all().
See #23358.
Built from https://develop.svn.wordpress.org/trunk@36686


git-svn-id: http://core.svn.wordpress.org/trunk@36653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 16:34:25 +00:00
Dominik Schilling
86690daf0b Multisite: Switch to a usermeta key for email confirmation.
To prevent inconsistent data across sites in a network the new email address is now stored in usermeta. Adds visual feedback for the case when an update has failed.
All existing options will be removed on a database upgrade.

Props MikeHansenMe, kovshenin, jeremyfelt, ocean90.
Fixes #23358.
Built from https://develop.svn.wordpress.org/trunk@36679


git-svn-id: http://core.svn.wordpress.org/trunk@36646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 15:34:28 +00:00
Eric Lewis
22467e840f Networks and sites: Replace "blog" usage with "site" in docs.
Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.

See #35417.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-28 03:35:27 +00:00
Dion Hulse
06a3f799e7 Background Updates: Remove the 7am/7pm background update check. This check was made redundant by [28129] as background updates are now run after a version check takes place.
See #27772, #35323.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-06 06:12:26 +00:00
Drew Jaynes
c9a11ae9f2 Docs: Mark the upgrade_XX() functions to be ignored from parsing for the Code Reference.
There is no great value in generating reference pages for these funcitons as they explicitly serve a core-only purpose.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-16 17:59:27 +00:00
Boone Gorges
f173cdfb18 On 4.4 upgrade, remove the unused 'add_users' cap from all roles.
Fixes #16719.
Built from https://develop.svn.wordpress.org/trunk@35701


git-svn-id: http://core.svn.wordpress.org/trunk@35665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-19 03:53:28 +00:00
Sergey Biryukov
db8c89cccb Remove non-translatable HTML code from the first post content in populate_network() and wp_install_defaults().
Add translator comment.

Props ramiy.
Fixes #34619.
Built from https://develop.svn.wordpress.org/trunk@35614


git-svn-id: http://core.svn.wordpress.org/trunk@35578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-11 20:55:26 +00:00
Gary Pendergast
c39ae3e5e2 Upgrades: Add support for FULLTEXT indexes to dbDelta().
Props edirect24, mdawaffe, pento.

Fixes #14445.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-01 23:10:25 +00:00
Drew Jaynes
217b661703 Docs: Add missing descriptions for the $wpdb global in DocBlocks all the places.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-14 23:44:25 +00:00
Sergey Biryukov
3c7b7f7133 After [34529], if a compatible termmeta table is found on database upgrade, convert it to utf8mb4 collation.
Props dboulet.
Fixes #34224.
Built from https://develop.svn.wordpress.org/trunk@34978


git-svn-id: http://core.svn.wordpress.org/trunk@34943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 02:07:25 +00:00
Jeremy Felt
9926983b66 Revert [34778], continue using _site_option() for the current network.
The `_network_option()` parameter order will be changing to accept `$network_id` first. The `_site_option()` functions will remain in use throughout core as our way of retrieving a network option for the current network.

See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 17:11:25 +00:00
Jeremy Felt
54512d64cb MS: Use *_network_option() functions throughout core.
Replaces all uses of `*_site_option()` with the corresponding "network" function.

This excludes one usage in `wp-admin/admin-footer.php` that needs more investigation.

Props spacedmonkey.
See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 19:08:26 +00:00
Boone Gorges
8b4a5d1ec0 Introduce metadata for taxonomy terms.
Adds a new table to the database schema (`wp_termmeta`), and a set of
`*_term_meta()` API functions. `get_terms()` and `wp_get_object_terms()`
now also support 'meta_query' parameters, with syntax identical to other
uses of `WP_Meta_Query`.

When fetching terms via `get_terms()` or `wp_get_object_terms()`, metadata for
matched terms is preloaded into the cache by default. Disable this behavior
by setting the new `$update_term_meta_cache` paramater to `false`.

To maximize performance, within `WP_Query` loops, the termmeta cache is *not*
primed by default. Instead, we use a lazy-loading technique: metadata for all
terms belonging to posts in the loop is loaded into the cache the first time
that `get_term_meta()` is called within the loop.

Props boonebgorges, sirzooro.
See #10142.
Built from https://develop.svn.wordpress.org/trunk@34529


git-svn-id: http://core.svn.wordpress.org/trunk@34493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 03:59:27 +00:00
Gary Pendergast
0d85038ce6 Schema: Increase the length of wp_options.option_name.
It's pretty easy to run over the `option_name` length, which causes undefined behaviour when inserting and retrieving options. Increasing the length from `VARCHAR(64)` to `VARCHAR(191)` significantly reduces the risk of this occurring.

Because `option_name` has a `UNIQUE` index, we can only increase it to 191 characters, rather than 255. The index can only use a prefix of 191 characters, so will incorrectly restrict long different strings that have the same prefix, if we make the column longer.

Props scribu, OriginalEXE, khromov, MikeHansenMe, netweb, pento.

Fixes #13310.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 01:26:24 +00:00