Commit Graph

112 Commits

Author SHA1 Message Date
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
John Blackbourn
a2609c13fa Add $transient as a parameter to the set_transient_{transient} action.
Props SergeyBiryukov
Fixes #34269

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


git-svn-id: http://core.svn.wordpress.org/trunk@35047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 21:02:25 +00:00
Jeremy Felt
364e63b83b MS: Reject truthy, non-numeric network ids in _network_option().
A valid `$network_id` or `null`/`false` is expected as the first parameter for `_network_option()`. If something other than that is passed, we immediately return `false` rather than attempting to guess what network was intended.

See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 23:30:24 +00:00
Jeremy Felt
092478579a MS: Adjust _network_option() parameter order, $network_id is first.
This better aligns with expectations and matches the structure used by `_blog_option()`. The `_site_option()` functions remain as an appropriate method for working with the current network.

See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 22:44:27 +00:00
John Blackbourn
95045d629b Correctly set the secure flag for the test cookie based on the login URL scheme, and the same for the user settings cookies based on the admin URL scheme.
Fixes #34159

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


git-svn-id: http://core.svn.wordpress.org/trunk@34896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 03:05: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
Sergey Biryukov
2702fd12cf Transients: Clarify the expiration_of_site_transient_$transient filter description.
See #21330.
Built from https://develop.svn.wordpress.org/trunk@34878


git-svn-id: http://core.svn.wordpress.org/trunk@34843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 18:11:24 +00:00
Dominik Schilling
e237e59172 Transients: Rename filters added in [34865].
* `expiration_pre_set_transient_$transient` => `expiration_of_transient_$transient`
* `expiration_pre_set_site_transient_$transient` => `expiration_of_site_transient_$transient`

Fix hook docs.

Props chriscct7.
Fixes #21330.
Built from https://develop.svn.wordpress.org/trunk@34877


git-svn-id: http://core.svn.wordpress.org/trunk@34842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 17:59:25 +00:00
Scott Taylor
1dcc6e1b51 Transients, add filters for $expiration:
* `'expiration_pre_set_site_transient_' . $transient`
* `'expiration_pre_set_transient_' . $transient`
 
Props chriscct7, wpsmith, nacin.
Fixes #21330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 14:10:25 +00:00
Boone Gorges
0e7c1d3b14 Use wp_installing() instead of WP_INSTALLING constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828


git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:06:28 +00:00
Jeremy Felt
dba5a73119 Docs: Add deprecation note for $use_cache in get_site_option().
Props johnbillion.
See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 19:32:30 +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
Jeremy Felt
3c2273ef45 MS: Introduce *_network_option functions.
Introduces `add_network_option()`, `update_network_option()`, `get_network_option()`, and `delete_network_option()`, which use the internals previously found in the `*_site_option()` functions and allow for a network ID to enable cross network storage and retrieval of network options.

* `*_site_option()` functions are now wrappers for `*_network_option()` and will interact with options for the current network in a multisite environment.
* All will continue to fallback to `*_option()` for non-multisite uses.
* Adds basic tests for cross network storage and retrieval.
* Existing tests for `*_site_option()` functions provide coverage for storage and retrieval of current network options.

Props spacedmonkey, DrewAPicture, jeremyfelt.
See #28290.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 18:01:27 +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
Sergey Biryukov
99c85c5b45 Update the length limit in set_transient() docs after [34030].
Props OriginalEXE.
Fixes #13310.
Built from https://develop.svn.wordpress.org/trunk@34045


git-svn-id: http://core.svn.wordpress.org/trunk@34013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 15:10:27 +00:00
Scott Taylor
a829ee32ce User Settings: allow dashes in get|set_user_setting() in PHP and get|setUserSetting() in JS.
Add unit tests - there were none. Mock `set_user_setting()` since it won't run due to `headers_sent()` being `true`.

Fixes #22781.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-01 03:57:21 +00:00
Drew Jaynes
6a839cf091 Docs: Add a changelog entry to the set_site_transient_$transient hook doc for the $transient parameter, added in [33738].
Fixes #28402.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-28 15:41:21 +00:00