Commit Graph

79 Commits

Author SHA1 Message Date
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
Jeremy Felt
fa1e1a8850 Multisite: Implement the get_by_path method in WP_Network.
Move the internals of `get_network_by_path()` to `WP_Network()` and allow network objects to be retrieved by passing a requested domain and path.

Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:40:24 +00:00
Jeremy Felt
16b4096779 Multisite: Introduce the WP_Network class.
A `WP_Network` object initially matches a row from `wp_site` and is populated with additional properties used by WordPress core. The first iteration is used to retrieve an existing network based on data passed to the class.

* A network can be retrieved by its ID through `WP_Network::get_instance()`, following in the steps of `WP_Post` and `WP_Comment`.
* A network object can be created or completed by passing initial properties in as a standard object to `new WP_Network()`.

Using these methods, we are now able to populate the global `$current_site` during load via this class.

Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:31:26 +00:00
Jeremy Felt
2762f019f7 Multisite: Correct ms_not_installed() @since version for new parameters
Props dimadin.
See 27264.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 16:21:26 +00:00
Jeremy Felt
7278744dd0 Multisite: Remove $domain and $path globals in ms_not_installed()
Further reduces the reliance on these unnecessary globals.

Fixes #27264.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 03:53:24 +00:00
Scott Taylor
4d26d999ce Fix doc blocks for ms-*.php files.
A few functions can return a conditional instead of an `if`/`else` of `true`/`false`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 21:51:31 +00:00
Dominik Schilling
64fc7294b6 Use HTTPS URLs for codex.wordpress.org.
see #27115.
Built from https://develop.svn.wordpress.org/trunk@32116


git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Dominik Schilling
502c70ec99 Remove <code> tags from translatable strings.
Uncomment deprecation notice for `get_bloginfo( 'text_direction' )`, see [14360].

props ramiy, DrewAPicture.
fixes #30614.
Built from https://develop.svn.wordpress.org/trunk@31899


git-svn-id: http://core.svn.wordpress.org/trunk@31878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-26 15:17:28 +00:00
Jeremy Felt
3c4b95c1e3 Return HTTP status code 500 by default in ms_not_installed()
In admin views, specify a response code of 500 when using `wp_die()` to show an expanded message for a broken or missing multisite installation.

On front end views, use `dead_db()` rather than `die()` to generate the generic "Error establishing a database connection" message. `dead_db()` sets a status code of 500 by default and allows for the override of this generic error with a `db-error.php` template.

Props craig-ralston, jeremyfelt.

Fixes #30002.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-07 05:35:26 +00:00
Scott Taylor
5eb5afac34 For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 22:47:22 +00:00
Drew Jaynes
9955384dbe Ensure inline code is markdown-escaped as such, HTML tags are removed from summaries, and that code snippets in descriptions are properly indented.
Affects DocBlocks for the following core elements:
* Backtick-escape an HTML tag in the description for the `media_upload_mime_type_links()` hook
* Backtick-escape inline code in the description for `wp_get_active_network_plugins()`
* Remove HTML tags from the summaries for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks
* Backtick-escape HTML tags, add inline `@see` tags to parameter descriptions for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks

Props rarst.
See #30473.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-24 05:53:22 +00:00
Scott Taylor
05eeb16e30 Replace all uses of like_escape() with $wpdb->esc_like().
Props miqrogroove.
See #10041.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-10 00:44:15 +00:00
Sergey Biryukov
de9a9fd8ea Suggest get_current_site() as an alternative for get_current_site_name().
props jesin.
fixes #28346.
Built from https://develop.svn.wordpress.org/trunk@28573


git-svn-id: http://core.svn.wordpress.org/trunk@28398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-25 14:32:16 +00:00
Scott Taylor
c96d7fff01 In get_network_by_path(), $exact_domains is unused.
See #27882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 21:32:16 +00:00
Sergey Biryukov
d711c32138 Update deleted site message in ms_site_check().
props boonebgorges.
fixes #28150.
Built from https://develop.svn.wordpress.org/trunk@28321


git-svn-id: http://core.svn.wordpress.org/trunk@28149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 18:46:15 +00:00
Andrew Nacin
e239dfad43 Multisite: Treat 'www' as a special subdomain, reversing 3.9 regression.
props jeremyfelt.
fixes #27927.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 05:32:36 +00:00
Andrew Nacin
827b92a9bd Formally deprecate wpmu_current_site().
props jeremyfelt.
fixes #27702.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 21:28:16 +00:00
Drew Jaynes
a4f4744a3b Inline documentation improvements in wp-includes/ms-load.php for 3.9 functionality.
Clarifies some mixed type parameters, spacing and comment style, and language fixes.

See #27700.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 20:59:15 +00:00
Andrew Nacin
4fb0aa5ecb In get_site_by_path(), avoid passing $paths through prepare(). If a path contains a %, we end up with problems. see #27003.
Built from https://develop.svn.wordpress.org/trunk@27439


git-svn-id: http://core.svn.wordpress.org/trunk@27286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-06 18:18:15 +00:00
Andrew Nacin
0e9ef2491c Deprecate get_current_site_name(). see #27003.
Built from https://develop.svn.wordpress.org/trunk@27407


git-svn-id: http://core.svn.wordpress.org/trunk@27254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-05 06:39:21 +00:00
Andrew Nacin
0523624d31 Doc fixes for wp_get_network().
props TobiasBg.
see #27003.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 18:56:14 +00:00
Andrew Nacin
ffc4ca7b01 Introduce get_site_by_path() and further rewrite the site detection process for multisite.
This is the first big step to supporting arbitrary domains and paths. In this new approach, sites are detected first where possible, then the network is inferred. Allows filtering for arbitrary path segments, smooths out some weirdness, and removes various restrictions. A sunrise plugin could do much of its work by adding filters, if those are even needed.

see #27003.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-02 22:25:14 +00:00
Mark Jaquith
79fbaf2e4c Fix a sometimes notice in wpmu_current_site()
props johnjamesjacoby. see #27003.
Built from https://develop.svn.wordpress.org/trunk@27275


git-svn-id: http://core.svn.wordpress.org/trunk@27131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-25 20:53:13 +00:00
Andrew Nacin
eae1d5641d Multisite: Add get_network_by_path() and wp_get_network() to begin cleanup of multisite load.
Tries to get network detection under control by simplifying wpmu_current_site(). It now also pops off each subdomain to find a more general match. Adds unit tests for get_network_by_path() and a new network factory for unit tests.

Much of this is likely to change in 3.9 as more of ms-load.php and ms-settings.php gets hacked to bits.

props jeremyfelt.
see #27003.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-13 23:07:14 +00:00
Andrew Nacin
fb3985663a Remove an unnecessary variable passed to wpdb::prepare() during multisite load.
props jeremyfelt.
fixes #26941.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-02 22:09:12 +00:00
Sergey Biryukov
74f77b85a6 Use get_current_site() instead of the $current_site global when possible.
props jeremyfelt.
fixes #25158.
Built from https://develop.svn.wordpress.org/trunk@26120


git-svn-id: http://core.svn.wordpress.org/trunk@26032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-13 03:23:10 +00:00
Andrew Nacin
d0cfa40983 Add jshintrc to qunit.
props jorbin.
see #25187.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-30 14:39:10 +00:00
Andrew Nacin
70fd806759 Revert r25824:25875 from the core.svn.wordpress.org repository.
These commits were accidentally re-synced commits from develop.svn.wordpress.org due to a race condition. Thankfully, the history of this repository matters fairly little. It also happened only for trunk.


git-svn-id: http://core.svn.wordpress.org/trunk@25876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-25 02:29:52 +00:00
Andrew Nacin
8ae8e01b67 Remove the old wp_auto_updates_maybe_update cron event. Schedule the new wp_maybe_auto_update event at 7 a.m. and 7 p.m. in the site's timezone.
see #27704.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-24 22:53:14 +00:00
Ryan Boren
b87d4b77e5 Pinking shears
Built from https://develop.svn.wordpress.org/trunk@25880


git-svn-id: http://core.svn.wordpress.org/trunk@25792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-23 14:38:10 +00:00
Drew Jaynes
bc7ea63093 Inline documentation for hooks in wp-includes/ms-load.php.
Props nukaga, johnbillion.
Fixes #25509.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-08 20:01:09 +00:00
Andrew Nacin
3ddb3c0abb Remove some old debug cruft left by yours truly. fixes #24462.
git-svn-id: http://core.svn.wordpress.org/trunk@24518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-26 19:33:58 +00:00
Andrew Nacin
a518fb0c94 Fix usage of undeclared variables.
* the_weekday_date() needs the global $currentday
 * ms_site_check() needs the global $current_site
 * media list table does not need to check for $total_orphans
 * upgrader has no $feedback variable, appears to be copypasta from other upgrade APIs
 * install_themes_feature_list() has no $features variable, return array() instead of a new return type of WP_Error

see #24210.



git-svn-id: http://core.svn.wordpress.org/trunk@24189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-07 16:35:03 +00:00
Andrew Nacin
837fadc3dc Merge two strings. props pavelevap, see #22306.
git-svn-id: http://core.svn.wordpress.org/trunk@22449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 22:03:23 +00:00
Ryan Boren
7a86de87fb Reduce use of global. Use get_blog_details() instead. fixes #22090
git-svn-id: http://core.svn.wordpress.org/trunk@22108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 12:40:09 +00:00
nacin
81ed9a7563 Introduce wp_load_translations_early(), which can be used before the locale is properly loaded in order to translate early error strings. Internationalize setup-config.php -- translators no longer have a reason to modify this file. fixes #18180.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-26 20:34:27 +00:00
ryan
e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
dd32
d8494f4a54 Close WP_I18N_WHAT_DO_I_DO translation tag properly. Props Nao. Fixes #19328
git-svn-id: http://svn.automattic.com/wordpress/trunk@19395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-22 10:22:45 +00:00
ryan
28b1b4763d Avoid E_STRICT notices. see #18975
git-svn-id: http://svn.automattic.com/wordpress/trunk@19094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-31 19:38:46 +00:00
ryan
14da950982 Don't set the site_name cache on every call to get_current_site_name(). Props mark-k, solarissmoke. fixes #16676
git-svn-id: http://svn.automattic.com/wordpress/trunk@18604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-25 19:29:47 +00:00
PeteMall
800443d208 Ensure correct HTTP status code is returned. Props nacin, fixes #15799
git-svn-id: http://svn.automattic.com/wordpress/trunk@16906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-14 08:38:01 +00:00
nacin
440671b932 Initialize this variable.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-08 01:03:12 +00:00
ryan
86c173262f Load network plugins for wp-activate.php. Restore MU load order. Props blamenacin. fixes #14718
git-svn-id: http://svn.automattic.com/wordpress/trunk@16558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-11-24 00:19:38 +00:00
ryan
db718fc987 Cache to site_name instead of current_site_name. Props benward. fixes #14461
git-svn-id: http://svn.automattic.com/wordpress/trunk@15551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-31 18:17:20 +00:00
nacin
e91e34be6a Remove a @todo. see #14014.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-25 16:25:29 +00:00
nacin
b3c30fe1ff WPMU->Network Codex link updates. props wpmuguru, see #14014 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-25 16:15:43 +00:00
nacin
1852eae49f Deprecate VHOST in favor of a boolean, SUBDOMAIN_INSTALL. Core will keep VHOST defined for plugins' sake, but you should only define SUBDOMAIN_INSTALL. Throws a notice if VHOST is defined, and a warning if they somehow conflict. Sunrise can still handle them. fixes #11796.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-04 20:48:28 +00:00
nacin
9d077332ba Fix string in ms_not_installed().
git-svn-id: http://svn.automattic.com/wordpress/trunk@14367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 10:14:15 +00:00
nacin
223277cc44 Fix notice in ms_not_installed().
git-svn-id: http://svn.automattic.com/wordpress/trunk@14364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 09:51:40 +00:00