Commit Graph

57 Commits

Author SHA1 Message Date
Sergey Biryukov e72fff9cef 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov 8b5b3bb38c Administration: Add punctuation to "If you change this, we will send you an email" message on General Settings, Network Settings, and Profile screens.
Props kinjaldalwadi, donmhico.
Fixes #49235.

git-svn-id: https://develop.svn.wordpress.org/trunk@47143 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 00:26:37 +00:00
Sergey Biryukov cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov 00b03f2a6f I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.

git-svn-id: https://develop.svn.wordpress.org/trunk@45932 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-03 00:39:13 +00:00
Sergey Biryukov a7513ac8e0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45926 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-01 17:12:43 +00:00
Andrea Fercia 12c154717b Accessibility: Improve settings tables and forms after [45403].
- adds `role="presentation"` to the edit comment table 
- removes a few pointless `<fieldset>` elements
- adds a few missing `<label>` elements
- adds the CSS class `class="td-full"` to table rows spanning to multiple cells
- adds explicit `scope="row"` attribute to the table headers in `options-permalink.php`: this table is better communicated as data table 
- uses consistent label association in the "Privacy Settings" page
- in the installation page "Set up your database connection": associates descriptions to their inout fields using `aria-describedby`
- improves the link to gravatar.com in the `user-edit.php` page

See #46899.
Fixes #47390.


git-svn-id: https://develop.svn.wordpress.org/trunk@45416 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-25 15:18:24 +00:00
Sergey Biryukov a3fbc75237 Accessibility: Make sure layout tables across the admin are correctly linearized.
Adds `role="presentation"` to the `<table>` elements used for layout purposes.

Ideally, HTML tables should be used for tabular data. When tables are used for layout purposes, it's important to remove any native semantics so that assistive technologies can correctly announce the table content in a linearized fashion.

Props greatislander, afercia.
Fixes #46899.

git-svn-id: https://develop.svn.wordpress.org/trunk@45403 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-24 21:55:21 +00:00
Gary Pendergast 8efcc32fde Help: Update support forum links.
There are a lot of places in Core that link to https://wordpress.org/support/ for the support forums, but that's now the URL for HelpHub. The new forums link is https://wordpress.org/support/forums/.

Props jitendrabanjara1991, dilipbheda, mukesh27, ianbelanger.
Fixes #46790.



git-svn-id: https://develop.svn.wordpress.org/trunk@45140 602fd350-edb4-49c9-b593-d223f7449a82
2019-04-08 22:58:49 +00:00
Gary Pendergast a75d153eee 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
John Blackbourn d541798a64 Docs: Document more parameters and properties using typed array notation.
See #41756


git-svn-id: https://develop.svn.wordpress.org/trunk@42875 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-25 18:09:56 +00:00
Sergey Biryukov 1fddd69163 I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.
Add missing translator comments in `WP_Theme_Install_List_Table` and `wp_notify_postauthor()`.
Add missing commas in some translator comments.

Fixes #43523.

git-svn-id: https://develop.svn.wordpress.org/trunk@42827 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-11 16:43:59 +00:00
Sergey Biryukov 5bc3564249 Role/Capability: Make `install_languages` capability check less restrictive.
A user should still be able to have the capability, even when language packs cannot be automatically installed. The automatic installation part is separate from that now.

Props flixos90.
Fixes #42697.

git-svn-id: https://develop.svn.wordpress.org/trunk@42606 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 22:41:58 +00:00
Gary Pendergast 8f95800d52 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn 301ecdabe4 Options, Meta APIs: Require a confirmation link in an email to be clicked when a user attempts to change the network
admin email address on Multisite.

This mirrors the same functionality for the site admin email address and user profile email address.

Fixes #41254


git-svn-id: https://develop.svn.wordpress.org/trunk@41617 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-27 14:16:21 +00:00
John Blackbourn 8df2151660 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


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
Felix Arntz f16b2a650e Role/Capability: Introduce capabilities dedicated to installing and updating language files.
The new meta capabilities are called `install_languages` and `update_languages`. Prior to this change, there were no proper capability checks applied. Instead only the filesystem and related constants were checked, and for actual permissions a rather vague fallback was used where a user needed to have at least one of the other updating capabilities. In addition to being generally more verbose, the new capabilities make it possible for example to allow a user to update languages, but nothing else. By default they fall back to the original way of how they were handled.

Props johnbillion, flixos90.
Fixes #39677.


git-svn-id: https://develop.svn.wordpress.org/trunk@41268 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 18:30:28 +00:00
Drew Jaynes bce1b14c9a Docs: Reduce confusion in `@since MU` notationss by indicating the WP version (3.0.0) the code was merged into core while retaining the original context.
Props sathyapulse.
Fixes #41509.


git-svn-id: https://develop.svn.wordpress.org/trunk@41200 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 20:43:25 +00:00
Felix Arntz b5668c3527 Multisite: Remove full stops from radio and checkbox labels in the Network Settings screen.
This change brings consistency with the regular site administration panel settings pages: Radio and checkbox labels do not use full stops there, so those in the network administration panel should not either.

Props Ankit K Gupta.
Fixes #39319.


git-svn-id: https://develop.svn.wordpress.org/trunk@40953 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-26 19:19:49 +00:00
Jeremy Felt 2979167ba7 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38814 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-19 04:46:14 +00:00
Andrea Fercia 240b114fe8 Accessibility: Remove target=_blank from the Network screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38159. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@38721 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-04 07:02:48 +00:00
Jeremy Felt 61f014b9fc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@38657 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-27 15:38:47 +00:00
Sergey Biryukov aca32f8771 I18N: Replace unnecessary context with a translator comment for `%s KB` string on Network Settings screen.
Props ramiy.
Fixes #37496.

git-svn-id: https://develop.svn.wordpress.org/trunk@38322 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 00:10:49 +00:00
Dominik Schilling 1752b073e0 Network Admin: Replace "Options saved." notice with "Settings saved.".
"Settings saved." is already used on all other settings screens.

Fixes #37279.

git-svn-id: https://develop.svn.wordpress.org/trunk@37959 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-04 22:00:38 +00:00
Dominik Schilling (ocean90) 206380180e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37914 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-29 15:15:40 +00:00
Dominik Schilling (ocean90) a196640640 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37888 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-28 10:02:19 +00:00
Drew Jaynes 1cd420af5e Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.


git-svn-id: https://develop.svn.wordpress.org/trunk@37488 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-22 18:00:23 +00:00
Jeremy Felt 914df85ab4 Multisite: Improve escaping in network settings.
git-svn-id: https://develop.svn.wordpress.org/trunk@37124 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-30 15:58:29 +00:00
Sergey Biryukov 4249f900ca Remove `<code>` tags from translatable string in `wp-admin/network/settings.php`.
Add translator comment.

Props ramiy.
Fixes #34618.

git-svn-id: https://develop.svn.wordpress.org/trunk@35570 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-08 01:33:13 +00:00
Jeremy Felt c8019610c8 MS: Reflect falsy values for `upload_space_check_disabled` in UI.
If the network option for `upload_space_check_disabled` is missing or an empty string, we should reflect how it will be treated elsewhere in the UI.

Props stephenharris.
Fixes #33986.


git-svn-id: https://develop.svn.wordpress.org/trunk@35026 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-12 00:00:28 +00:00
Jeremy Felt 599fb50e09 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34912 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 17:11:01 +00:00
Jeremy Felt 3c177b8c6f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34778 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-02 19:07:23 +00:00
Andrea Fercia c81fe78b9c Bump H3 headings to H2 on the Network Settings screen for better accessibility.
Fixes #34078.

git-svn-id: https://develop.svn.wordpress.org/trunk@34695 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 18:51:20 +00:00
Scott Taylor b1a91e4a28 Move `network_settings_add_js()` from `wp-admin/network/settings.php` to `wp-admin/includes/ms.php`.
See #33813.


git-svn-id: https://develop.svn.wordpress.org/trunk@34026 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 22:23:47 +00:00
Konstantin Obenland e59592f87e 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@32974 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-27 15:40:27 +00:00
Andrew Nacin 17d6534bb1 Update wp_die() calls modified in [31658] to use shorthand calling style.
see #31422.


git-svn-id: https://develop.svn.wordpress.org/trunk@32152 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-20 03:26:24 +00:00
Dominik Schilling (ocean90) b0d6757918 Use HTTPS URLs for codex.wordpress.org.
see #27115.

git-svn-id: https://develop.svn.wordpress.org/trunk@32116 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-12 21:28:58 +00:00
Helen Hou-Sandi 35df5592f1 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31973 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-01 22:05:17 +00:00
Jeremy Felt a5fcc34a50 Return HTTP status code 403 in network admin when access is forbidden.
When the error message "You do not have permission to access this page" is used in network admin screens, return an HTTP status code of 403 to match. Previously: [30356] and [31300].

Props yo-l1982.

Fixes #31422.


git-svn-id: https://develop.svn.wordpress.org/trunk@31658 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 05:59:17 +00:00
Jeremy Felt ff0b2f7a6f 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@31517 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-23 02:28:41 +00:00
John Blackbourn 3f2827c5be Admin help text changes for the General Settings screen, post editing screen, network settings screen, and user editing screen.
Fixes #30547
Props kpdesign


git-svn-id: https://develop.svn.wordpress.org/trunk@30705 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-02 05:14:38 +00:00
Drew Jaynes (DrewAPicture) 403f4feb27 4.1 Docs Audit: Clarify the DocBlock summary for `network_settings_add_js()` to specify that it's specific to the Network Settings screen.
See #30469.


git-svn-id: https://develop.svn.wordpress.org/trunk@30603 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-28 09:08:08 +00:00
Dominik Schilling (ocean90) dc8e01fa9b Site Language: Install translations on the fly.
The language dropdown now includes installed languages and all available translations when the filesystem is writable by WordPress.
Go to wp-admin/options-general.php, select one of the available translations, submit the form and let WordPress handle the rest.
Works for Multisite's Default Language too.

see #29395.

git-svn-id: https://develop.svn.wordpress.org/trunk@30335 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-13 17:00:08 +00:00
Sergey Biryukov d552ba29bc * Declare $site_mimes before using it in check_upload_mimes().
* Use the same default value for 'upload_filetypes' as on Network Settings screen.

props rmccue.
fixes #29512 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@29718 602fd350-edb4-49c9-b593-d223f7449a82
2014-09-07 10:10:33 +00:00
Dominik Schilling (ocean90) 1f793ea9b2 Language packs: No WPLANG anymore.
* The WPLANG constant is no longer needed. Remove define('WPLANG', ''); from wp-config-sample.php. Populate WPLANG option based on the WPLANG constant. When get_option('WPLANG') is an empty string it will override WPLANG.
* Introduce translations_api() which is available to communicate with the translation API. Move translation install related functions to a new file.
* Replace mu_dropdown_languages() with wp_dropdown_languages(). wp_dropdown_languages() is now populated by the translation API.
* Remove wp_install_load_language() and allow load_default_textdomain() to switch a core translation.

fixes #13069, #15677, #19760, #28730, #29281. 

git-svn-id: https://develop.svn.wordpress.org/trunk@29630 602fd350-edb4-49c9-b593-d223f7449a82
2014-08-26 19:58:33 +00:00
John Blackbourn 0a4e8b2b7e Implement email and url input types where appropriate. Props Kau-Boy. Fixes #22183.
git-svn-id: https://develop.svn.wordpress.org/trunk@29030 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-08 17:51:58 +00:00
Andrew Nacin 4cf6fc1a99 Use SSL when linking to WordPress.org. see #27115.
git-svn-id: https://develop.svn.wordpress.org/trunk@27469 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 04:13:28 +00:00
Andrew Ozz 48d24f6bf5 Remove all "valign" attributes from tables in wp-admin, props MikeHansenMe, Marventus. Fixes #22712.
git-svn-id: https://develop.svn.wordpress.org/trunk@27029 602fd350-edb4-49c9-b593-d223f7449a82
2014-01-24 19:05:15 +00:00
Andrew Nacin 8b29fa45f7 westi forgot my full stop. see #23569.
git-svn-id: https://develop.svn.wordpress.org/trunk@26641 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 21:56:29 +00:00
Peter Westwood d78778e51f Improve the description of the Network Admin Email option to better describe what the address will be used for. Fixes #23569 props nacin.
git-svn-id: https://develop.svn.wordpress.org/trunk@26640 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 21:53:59 +00:00
Drew Jaynes 98fe4a5aed Hook docs pinking shears.
git-svn-id: https://develop.svn.wordpress.org/trunk@26631 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-04 20:02:53 +00:00