Commit Graph

71 Commits

Author SHA1 Message Date
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
Andrea Fercia 902cb70328 Accessibility: Remove target=_blank from the Network screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38159. See #23432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 07:03:31 +00:00
Jeremy Felt 3d19ab1ce2 Multisite: Remove redundant `is_multisite()` checks in network admin templates.
`wp-admin/network/admin.php` is required by all of the individual network templates and begins with an `is_multisite()` check of its own. Because of this, we can remove the 26 other checks in the individual templates.

Props flixos90.
Fixes #37447.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 15:39:29 +00:00
Dominik Schilling 4a6f90db58 Multisite: Allow to set the site language of a new site to English.
An empty string in `WPLANG` is used to define the site language as `en_US`. The `! empty()` check didn't catch this case so that `wpmu_create_blog()` fell back to the network setting.

Fixes #36918.
Built from https://develop.svn.wordpress.org/trunk@38655


git-svn-id: http://core.svn.wordpress.org/trunk@38598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-26 18:39:32 +00:00
Dominik Schilling 25e66e4f1e Text Changes: Unify permission error messages.
The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.
Built from https://develop.svn.wordpress.org/trunk@37914


git-svn-id: http://core.svn.wordpress.org/trunk@37855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 15:16:29 +00:00
Drew Jaynes fc57bb7a04 Docs: Minorly improve the hook doc summary for the `pre_network_site_new_created_user` action, introduced in [35786].
See #33631. See #35986.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-03 09:03:25 +00:00
Sergey Biryukov d986a84152 I18N: Remove `<code>` tag from translatable string in `wp-admin/network/site-new.php`.
Props ramiy.
Fixes #35989.
Built from https://develop.svn.wordpress.org/trunk@36771


git-svn-id: http://core.svn.wordpress.org/trunk@36738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-29 02:44:26 +00:00
Jeremy Felt 89771acf96 Multisite: Use "Site Address (URL)" in site-new.php.
This uses the same string as single site and `site-info.php` when editing a site in multisite.

Fixes #35934.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 16:14:27 +00:00
Sergey Biryukov 4a2676ab8b I18N: Add translator comments and context to "New Site Created" email notification strings.
Props ramiy.
Fixes #35716.
Built from https://develop.svn.wordpress.org/trunk@36669


git-svn-id: http://core.svn.wordpress.org/trunk@36636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 02:04:28 +00:00
Jeremy Felt 39cd3583a4 Multisite: Add a hook to the end of the Add Site form.
The `network_site_new_form` action can be used to extend the new site form.

Props igmoweb, ocean90.
Fixes #34739.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-17 19:03:25 +00:00
Jeremy Felt b24fd73bd0 MS: Update "Add New Site" address description text for accuracy.
Add hyphens to the list of allowed characters and add the `description` class to helper text paragraph tag.

Props thomaswm for the initial patch.
Fixes #26388.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-13 03:13:27 +00:00
Rachel Baker 2cd2cb6e17 Multisite: Clarify purpose of hook from [35786] and match our naming convention.
`network_site_new_created_user_pending` -> `pre_network_site_new_created_user` 

See #33631

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


git-svn-id: http://core.svn.wordpress.org/trunk@35753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 20:32:24 +00:00
Rachel Baker 66ea0d6e1b Multisite: Add hook before a new user is created during the creation of a new site.
New `network_site_new_created_user_pending` action fires before a new user will be created via the network site-new.php page. 

Props mackensen
Fixes #33631

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


git-svn-id: http://core.svn.wordpress.org/trunk@35750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 20:10:26 +00:00
Jeremy Felt f8a05879e8 MS: Show an error if a new site slug conflicts with an existing username.
Props utkarshpatel, dipesh.kakadiya.
Fixes #33804.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-10 01:42:26 +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
Drew Jaynes 65133a89c1 Multisite: Introduce `get_subdirectory_reserved_names()`, which returns a filterable list of reserved subdirectory site names.
The function encapsulates the existing `subdirectory_reserved_names` filter and reduces the maintenance burden of keeping the value of (currently) two instances of the same hook in sync.

See #33615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:35:25 +00:00
Scott Taylor 3ef27f7929 oEmbed: add `embed` to `$subdirectory_reserved_names`.
Props jeremyfelt.
See #32522.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 03:45: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 ea03ecbe66 Fixes #33816.
MS: Adjust formatting of code in `site-new.php` to improve readability.

Fixes #34066.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-28 23:30:24 +00:00
Scott Taylor c60b00fc20 Multisite: as a precaution, make `wp-json` a reserved subdirectory name.
Props austinginder.
Fixes #33789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 04:21:25 +00:00
Helen Hou-Sandí 48befcf361 Superglobals: Revert [34059] until further notice.
see #33837.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 12:33:26 +00:00
Boone Gorges 85c00bd943 Move new user notification emails to `add_action()` callbacks.
When a new user is created in various places throughout the interface,
notifications are sent to the site admin and the new user. Previously, these
notifications were fired through direct calls to `wp_new_user_notification()`,
making it difficult to stop or modify the messages.

This changeset introduces a number of new action hooks in place of direct calls
to `wp_new_user_notification()`, and hooks the new wrapper function
`wp_send_new_user_notifications()` to these hooks.

Props dshanske, thomaswm, boonebgorges.
Fixes #33587.
Built from https://develop.svn.wordpress.org/trunk@34251


git-svn-id: http://core.svn.wordpress.org/trunk@34215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 22:19:24 +00:00
Dominik Schilling 4af3a3374e Passwords: Deprecate second parameter of `wp_new_user_notification()`.
The second parameter `$plaintext_pass` was removed in [33023] and restored as `$notify` in [33620] with a different behavior. If you have a plugin overriding `wp_new_user_notification()` which hasn't been updated you would get a notification with your username and the password "both".
To prevent this the second parameter is now deprecated and reintroduced as the third parameter.

Adds unit tests.

Props kraftbj, adamsilverstein, welcher, ocean90.
Fixes #33654.

(Don't ask for new pluggables kthxbye)
Built from https://develop.svn.wordpress.org/trunk@34116


git-svn-id: http://core.svn.wordpress.org/trunk@34084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 12:43:26 +00:00
Scott Taylor cd7c0f0b0d Introduce `wp_validate_action( $action = '' )`, a helper function that checks `$_REQUEST` for `action` and returns it, or empty string if not present. If `$action` is passed, it checks to make sure they match before returning it, or an empty string. Strings are always returned to avoid returning multiple types.
Implementing this removes 27 uses of direct superglobal access in the admin.

For more reading:
https://codeclimate.com/github/WordPress/WordPress/wp-admin/edit-comments.php

See #33837.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 21:08:26 +00:00
Scott Taylor 3d8199c4eb Multisite: Don't allow sites to be created with the following reserved slugs: `wp-admin`, `wp-content`, `wp-includes`
Props austinginder.
Fixes #33615.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 19:32:24 +00:00
John Blackbourn 4d76ce2521 Implement a language chooser on the Network Admin -> Sites -> Add New screen.
Props DrewAPicture
Fixes #33528

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


git-svn-id: http://core.svn.wordpress.org/trunk@33889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-05 20:47:24 +00:00
Konstantin Obenland e6bc6242ad Passwords: Restore second parameter for `wp_new_user_notification()`.
After [33023] users would always be notified, this restores previous behavior.

Props markjaquith, ocean90.
Fixes #33358.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-17 14:25:27 +00:00
Jeremy Felt 67142f5a2f Don't autocapitalize or autocorrect domain or path when adding a new site in iOS.
Props @ohryan.
Fixes #32646.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-04 04:40:25 +00:00
Konstantin Obenland 7dc1d06e64 Proper heading for admin screens.
First step towards restoring a good heading structure in wp-admin.
The previous `<h1>` contained the site title and a link to the front page and was removed with the toolbar refactoring in 3.2.

Props joedolson, afercia.
Fixes #31650.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 15:41:25 +00:00
Scott Taylor d2a00338f6 Don't loosely compare functions that return `bool` against a literal `bool`.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-12 17:19:27 +00:00
Sergey Biryukov 5a0f970b2e Use correct closing tag.
props eligijus, TobiasBg.
fixes #32205.
Built from https://develop.svn.wordpress.org/trunk@32328


git-svn-id: http://core.svn.wordpress.org/trunk@32299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-30 14:30:25 +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
Helen Hou-Sandí d85f8fe326 Admin notices: Make (most) core notices dismissible.
These no longer return upon refreshing the page when JS is on and working, so users should be able to dismiss them. This is particularly important on the post edit screen when DFW is triggered, but pretty much all notices can be dismissed if needed. A post on Make/Core will follow with information on how this can be leveraged in plugins.

props valendesigns, afercia, paulwilde, adamsilverstein, helen.
fixes #31233. see #23367.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 22:06:28 +00:00
Sergey Biryukov 29cddbeda9 Add translator comments for placeholders in network-related strings.
props ramiy.
fixes #31834.
Built from https://develop.svn.wordpress.org/trunk@31956


git-svn-id: http://core.svn.wordpress.org/trunk@31935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 13:26:28 +00:00
Jeremy Felt 7644e68119 Provide proper label associations and descriptions throughout the network admin
* Add labels previously missing for many inputs throughout the network admin screen.
* Add proper `aria-describedby` attributes to provide better descriptions.
* Wrap grouped inputs with `fieldset` elements.
* Remove now unneeded `title` attributes when appropriate.

Props cfoellmann, afercia, rianrietveld.

Fixes #38406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-23 02:29:26 +00:00
Dominik Schilling 184d327ff4 Network Admin: Improve width of input fields on Add New Site and Edit Site screens.
props honeysilvas.
fixes #16383.
Built from https://develop.svn.wordpress.org/trunk@30578


git-svn-id: http://core.svn.wordpress.org/trunk@30568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-26 19:51:23 +00:00
Jeremy Felt 1ffba4abc4 Differentiate between invalid and missing admin emails when adding a new site
Check the emptiness of the admin email before using `sanitize_email()` and `is_email()` to determine if the address is valid.

Fixes #17890

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


git-svn-id: http://core.svn.wordpress.org/trunk@29634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-12 00:22:18 +00:00
John Blackbourn be12ea968a Implement email and url input types where appropriate. Props Kau-Boy. Fixes #22183.
Built from https://develop.svn.wordpress.org/trunk@29030


git-svn-id: http://core.svn.wordpress.org/trunk@28818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-08 17:52:14 +00:00
Andrew Nacin dce0b9adea Use SSL when linking to WordPress.org. see #27115.
Built from https://develop.svn.wordpress.org/trunk@27469


git-svn-id: http://core.svn.wordpress.org/trunk@27314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 04:14:15 +00:00
Helen Hou-Sandí 291ed370b4 Autocomplete for the new site admin email. Better than trying to remember which email address you used.
fixes #25348.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-27 23:10:12 +00:00
Andrew Ozz 8d6059b383 Remove all screen_icon() calls and deprecate the functions, props TobiasBg, fixes #26119
Built from https://develop.svn.wordpress.org/trunk@26518


git-svn-id: http://core.svn.wordpress.org/trunk@26411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-02 03:53:11 +00:00
Sergey Biryukov 53d47bf514 Remove redundant current_user_can() check. props jeremyfelt. fixes #26057.
Built from https://develop.svn.wordpress.org/trunk@26236


git-svn-id: http://core.svn.wordpress.org/trunk@26143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-16 17:38:11 +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 fd57b239d2 Don't rely on include_path to include files.
Always use dirname() or, once available, ABSPATH.

props ketwaroo, hakre.
fixes #17092.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-25 00:18:11 +00:00
Ryan Boren f3a83744e9 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
git-svn-id: http://core.svn.wordpress.org/trunk@23567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:14:09 +00:00
Ryan Boren 43a7e695e9 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Ryan Boren cc5ed3a485 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Andrew Nacin f5e7edf2f2 Add manual new lines to a string, as double quotes with \n is not optimal due to sprintf-parsing reasons. props SergeyBiryukov, fixes #22486. see #22260.
git-svn-id: http://core.svn.wordpress.org/trunk@22664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-19 06:11:42 +00:00
Peter Westwood 1f76fa3703 i18n: Fix the usage of sprintf replacements in the Multisite Network Admin new site page. See #22260.
git-svn-id: http://core.svn.wordpress.org/trunk@22272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-23 11:30:09 +00:00
Ryan Boren 51920e1858 Consolidate some strings. Props pavelevap, SergeyBiryukov. see #21728
git-svn-id: http://core.svn.wordpress.org/trunk@22124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-05 19:04:34 +00:00