Commit Graph

128 Commits

Author SHA1 Message Date
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
Felix Arntz 57fd97017e Multisite: Ensure the `{$network_id}:notoptions` array is set in cache in `get_network_option()`.
Prior to this change, the `{$network_id}:notoptions` cache would only be fetched, but not set, unless the actual database lookup would be unsuccessful. This enhancement slightly improves performance by preventing unnecessary external object cache lookups if one is used.

Fixes #43506.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-13 15:37:33 +00:00
Felix Arntz f3eaddd2dc Options: Unhook default option filter when setting is unregistered.
Fixes #43207.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-06 14:49:32 +00:00
Joe Hoyle 389283f5bd REST API: Include permalink_structure in the settings route.
There are situations where the REST API client wants to be able to read and set the permalink_structure option. Though this doesn’t fix the use case of front-end rendered unauthenticated websites, it still has utility as a setting in it’s own right.

Props aduth.
See #41014.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-03 22:29:45 +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 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
Sergey Biryukov 5dd45b38c8 Transients: After [41963], add missing cron task for `delete_expired_transients()`.
Props dlh.
Fixes #41699.
Built from https://develop.svn.wordpress.org/trunk@42008


git-svn-id: http://core.svn.wordpress.org/trunk@41842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 23:00:47 +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
Gary Pendergast 88f71a8adf Options: Add new `alloptions` and `pre_cache_alloptions` filters.
`pre_cache_alloptions` is run before the alloptions array is inserted into the cache, and is valuable for sanity checking the options, particularly if your caching scheme has size limitations.

`alloptions` is run before returning the alloptions array, and is useful for when you have extra information that alloptions should return.

Props sebastian.pisula, keesiemeijer.
Fixes #33958.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 00:23:47 +00:00
Felix Arntz 473e1ba73b Multisite: Remove references to `$wpdb->siteid` and use `get_current_network_id()` instead.
Props sathyapulse, spacedmonkey.
Fixes #41507.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 13:11:43 +00:00
Felix Arntz 820d3973a3 Multisite: Rename internal `$site_id` variables referencing networks to `$network_id`.
This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-12 12:48:47 +00:00
Drew Jaynes fdaf531325 Options: Pass `$default` as a new parameter to the `pre_option_{$option}` and `pre_site_option_{$option}` filters.
This change standardizes some language in the parameter descriptions between the two hook docs in an effort to reduce confusion between the `$pre_option` pseudo-parameters and the new `$default` ones. `$pre_option` is the truthy value used to short-circuit the `get_*option()` call, `$default` is the value passed to the `get_*option()` returned in the event that 1) a short circuit isn't performed, 2) the option doesn't exist.

Props sc0ttkclark.
Fixes #41254.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 15:12:44 +00:00
Ryan McCue 3ecfb4b222 Options/Meta: Document valid types for registration.
In 4.7, the REST API introduced types for options and meta passed into the registration functions. This adds the documentation for those types.

Props iandunn, priyankabehera155.
Fixes #40318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-10 06:10:43 +00:00
Sergey Biryukov 7ee5878a9c Docs: Update the length limit in `set_site_transient()` docs after [34030].
Props lukecavanagh, jdgrimes.
Fixes #40455.
Built from https://develop.svn.wordpress.org/trunk@40432


git-svn-id: http://core.svn.wordpress.org/trunk@40330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 09:28:43 +00:00
Sergey Biryukov 9d7ea04936 I18N: Merge similar strings in `_deprecated_argument()` calls.
Add translator comments.

Props ramiy, SergeyBiryukov.
Fixes #39020.
Built from https://develop.svn.wordpress.org/trunk@40028


git-svn-id: http://core.svn.wordpress.org/trunk@39965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 11:50:41 +00:00
Felix Arntz dd23a8f48c Multisite: Do not check for `is_super_admin()` when trying to set user settings.
The checks were introduced in [22256] to prevent user settings to be set for super admins that were not a member of the current site. However the latter should apply to any kind of user, so the `is_super_admin()` check is redundant. Furthermore, removing these checks is necessary for the ongoing effort to get rid of `is_super_admin()` checks in general.

Props chandrapatel for initial patch.
Fixes #39199. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-20 17:33:41 +00:00
John Blackbourn 4548b08236 General: Use interpolation instead of concatenation for all dynamic hook names.
This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148

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


git-svn-id: http://core.svn.wordpress.org/trunk@39540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 04:18:42 +00:00
Peter Wilson c21907ca1e Options: Prevent unnecessary SQL updates by `update_option`.
Previously an option containing an object would trigger an SQL `UPDATE` on all calls to `update_option`, even if the old and new values were identical. This was due to the old and new values having differing resource IDs.

This change compares the old and new values as serialized data to remove the resource ID from the comparison.

Props salcode, bradyvercher, peterwilsoncc.
Fixes #38903.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-11 21:43:43 +00:00
Andrew Nacin cafb341db6 REST API: Register the admin_email setting in single site only.
fixes #38990.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-03 05:39:42 +00:00
Gary Pendergast d7e0ae883c REST API: Site URL setting should not be present on multisite installations.
The `siteurl` setting is registered and made available to the REST API. On a multisite installation, this setting is not configurable from the General Settings screen, but due to the above it is configurable from the REST API.

Props peterwilsoncc.
Fixes #39005.


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


git-svn-id: http://core.svn.wordpress.org/trunk@39408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-03 05:16:44 +00:00
Rachel Baker 1448bfc96f REST API: Correct the `admin_email` setting description for single site installs.
Display different descriptions for multisite or single site installations.

Props johnbillion, ocean90.
Fixes #38990.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-01 03:03:43 +00:00
Dominik Schilling 1c0e51452f Options: Pass the `$passed_default` parameter to the `'default_option_{$option}` filter in `add_option()`.
This was missed in [38910].

Props joehoyle, lucasstark.
See #38176.
Fixes #38930.
Built from https://develop.svn.wordpress.org/trunk@39382


git-svn-id: http://core.svn.wordpress.org/trunk@39322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-30 21:22:41 +00:00
Joe Hoyle 014bb86248 REST API: Update description strings to match already existing ones in the admin.
Props dimadin.
Fixes #38807.
Built from https://develop.svn.wordpress.org/trunk@39335


git-svn-id: http://core.svn.wordpress.org/trunk@39275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-21 20:41:30 +00:00
Joe Hoyle f1591eccca REST API: Add support for "integer" type for meta and options
Previously Settings only supported "number" which meant it was possible to push floats to things like posts_per_page. This means now developers can also specify `type => ineger` in meta nad settings resgration.

Props flixos90.
Fixes #38393.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 16:07:31 +00:00
Rachel Baker 21e0f964e3 REST API: Add the `default_comment_status` and `default_ping_status` options to the setting endpoint.
Props joehoyle.
See #38490.
Built from https://develop.svn.wordpress.org/trunk@38971


git-svn-id: http://core.svn.wordpress.org/trunk@38914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:21:01 +00:00
Jeremy Felt 8972cb70b6 Options: Make `$passed_default` available in remaining `default_option_{$option}` filter.
Pass `false` as the `$passed_default` value when the `default_option_{$option}` filter is applied in `update_option` as no default is ever passed.

This resolves an error in tests where the 3rd parameter is not available to `filter_default_option()`.

Fixes #38176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 19:23:32 +00:00
Joe Hoyle 5f777155f2 Options: Add 'default' to register_setting
Add a `default` argument to `register_setting` that will be used an the default option value viet `get_option()` in the event of no other option being specified. This means (if chosen) developers can define their default once via `register_option` and not have to duplicate the value every time they make a call to `get_option()`.

Props rmccue, jorbin, jtsternberg.
Fixes #38176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:08:29 +00:00
Rachel Baker e4a7c0a397 REST API: Introduce the Content API endpoints.
REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of the following:
- Posts: Read and write access to all post data, for all types of post-based data, including pages and media.
- Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.
- Terms: Read and write access to all term data.
- Users: Read and write access to all user data. This includes public access to some data for post authors.
- Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.
- Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.

Love your REST API, WordPress!  The infrastructure says, "Let's do lunch!" but the content API endpoints say, "You're paying!"

Props rmccue, rachelbaker, danielbachhuber, joehoyle, adamsilverstein, afurculita, ahmadawais, airesvsg, alisspers, antisilent, apokalyptik, artoliukkonen, attitude, boonebgorges, bradyvercher, brianhogg, caseypatrickdriscoll, chopinbach, chredd, christianesperar, chrisvanpatten, claudiolabarbera, claudiosmweb, cmmarslender, codebykat, coderkevin, codfish, codonnell822, daggerhart, danielpunkass, davidbhayes, delphinus, desrosj, dimadin, dotancohen, DrewAPicture, Dudo1985, duncanjbrown, eherman24, eivhyl, eliorivero, elyobo, en-alis, ericandrewlewis, ericpedia, evansobkowicz, fjarrett, frozzare, georgestephanis, greatislander, guavaworks, hideokamoto, hkdobrev, hubdotcom, hurtige, iandunn, ircrash, ironpaperweight, iseulde, Japh, jaredcobb, JDGrimes, jdolan, jdoubleu, jeremyfelt, jimt, jjeaton, jmusal, jnylen0, johanmynhardt, johnbillion, jonathanbardo, jorbin, joshkadis, JPry, jshreve, jtsternberg, JustinSainton, kacperszurek, kadamwhite, kalenjohnson, kellbot, kjbenk, kokarn, krogsgard, kuchenundkakao, kuldipem, kwight, lgedeon, lukepettway, mantismamita, markoheijnen, matrixik, mattheu, mauteri, maxcutler, mayukojpn, michael-arestad, miyauchi, mjbanks, modemlooper, mrbobbybryant, NateWr, nathanrice, netweb, NikV, nullvariable, oskosk, oso96_2000, oxymoron, pcfreak30, pento, peterwilsoncc, Pezzab, phh, pippinsplugins, pjgalbraith, pkevan, pollyplummer, pushred, quasel, QWp6t, schlessera, schrapel, Shelob9, shprink, simonlampen, Soean, solal, tapsboy, tfrommen, tharsheblows, thenbrent, tierra, tlovett1, tnegri, tobych, Toddses, toro_unit, traversal, vanillalounge, vishalkakadiya, wanecek, web2style, webbgaraget, websupporter, westonruter, whyisjake, wonderboymusic, wpsmith, xknown, zyphonic.
Fixes #38373.
Built from https://develop.svn.wordpress.org/trunk@38832


git-svn-id: http://core.svn.wordpress.org/trunk@38775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 02:55:32 +00:00
Jeremy Felt 432d90050b Multisite: Add `$network_id` parameter to hooks in `delete_network_option()`.
Props flixos90.
Fixes #38322.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:02:29 +00:00
Jeremy Felt eb382b29ae Multisite: Add `$network_id` parameter to hooks in `update_network_option()`.
Props flixos90.
Fixes #38321.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:00:29 +00:00
Jeremy Felt 213a0a2477 Multisite: Add $network_id parameter to hooks in `add_network_option()`.
Props flixos90.
Fixes #38320.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:56:28 +00:00
Jeremy Felt df6675d1ec Multisite: Add `$network_id` parameter to filters in `get_network_option()`.
Props flixos90.
Fixes #38319.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:54:29 +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
Ryan McCue 7cd7c828cc Options: Move register_setting() from wp-admin to wp-includes.
With [38635], register_setting is now a more generic setting registration function and is usable outside of the admin.

See #37885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 15:53:29 +00:00
Jeremy Felt 58f107fa95 Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 21:39:29 +00:00
Scott Taylor 08233c6aff Multisite: move `get_current_site()` to `load.php` so that it can be used in more places, instead of importing `global $current_site`.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:35:30 +00:00
Scott Taylor b7812bd416 AJAX: add a new function, `wp_doing_ajax()`, which can replace... (wait for it...) `DOING_AJAX` checks via the constant.
Props Mte90, sebastian.pisula, swissspidy.
Fixes #25669.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 14:33:30 +00:00
Drew Jaynes 22adda2aa0 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 18:25:31 +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
Drew Jaynes 94980d89e0 Docs: Make the DocBlock summary for `get_option()` more explicit and convert to using a third-person singular verb.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 17:29:30 +00:00
Drew Jaynes 9193013158 Docs: Apply inline `@see` tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

Fixes #36921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes bde87c6fb2 Docs: Standardize filter docs in wp-includes/option.php to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:34:26 +00:00
Sergey Biryukov b65cbd6003 Options: After [33738], consistently pass option name as the second parameter to the `'default_option_' . $option` filter in `add_option()` and `update_option()`.
Props dlh.
Fixes #36761.
Built from https://develop.svn.wordpress.org/trunk@37367


git-svn-id: http://core.svn.wordpress.org/trunk@37333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-05 20:24:29 +00:00
Drew Jaynes ddd3daf5ad Docs: Clarify return descriptions in the DocBlocks for `set_user_setting()` and `delete_user_setting()`.
See [32613]. See #30989.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 15:47:26 +00:00
Drew Jaynes 14a399b69a Docs: Clarify parameter and return descriptions in the DocBlock for `wp_set_all_user_settings()`.
See [32613]. See #30989.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 15:45:29 +00:00
Jeremy Felt f6620f7b7f Options: Do not set network options to autoload in single site
When multisite is not configured, the `_site_transient()` and `_site_option()` functions fallback to `_option()` and store network "meta/options" in `wp_options`.

Previously, those calls to `_option()` did not explicitly set the `autoload` parameter and anything assigned as a transient or option at the network level would be set to `autoload` by default, even though autoload is not yet a concept at the network option level.

This changes that behavior and forces the `autoload` setting to `no`. If `autoload` is desired, the single site option functions should be used.

Props thomaswm.
Fixes #22846.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-16 19:48:27 +00:00
Boone Gorges 4ce9b93af9 Clarify return types in `get_option()` documentation.
The new note specifies that scalar values will always be returned as strings.

Fixes #31820.
Built from https://develop.svn.wordpress.org/trunk@36234


git-svn-id: http://core.svn.wordpress.org/trunk@36201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-09 03:12:26 +00:00
Sergey Biryukov 1b0bc28579 Rename internal variable in `set_transient()`.
The previous name was inadvertently changing the dynamic part of `set_transient_{transient}` action and the transient name passed to the action since [35082].

Props GregLone.
Fixes #34470.
Built from https://develop.svn.wordpress.org/trunk@35431


git-svn-id: http://core.svn.wordpress.org/trunk@35395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-29 11:52:28 +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
John Blackbourn 537ac4c2ec Improve the docs for the `$expiration` parameter in `set_transient()`, `set_site_transient()`, and associated filters.
See #32246

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


git-svn-id: http://core.svn.wordpress.org/trunk@35115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 21:31:25 +00:00