Commit Graph

373 Commits

Author SHA1 Message Date
youknowriad
cb6c706152 Editor: Show the patterns page for classic themes.
Block themes and classic themes with template parts support 
can already access the patterns list within the site editor.
This adds a "Patterns" menu item under Appearance for classic themes
without template parts support.

Props wildworks, kevin940726, aaronrobertshaw, fabiankaegy, swissspidy, get_dave, kebbet.
Fixes #58827.
Built from https://develop.svn.wordpress.org/trunk@57543


git-svn-id: http://core.svn.wordpress.org/trunk@57044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-02-06 19:42:13 +00:00
Sergey Biryukov
7eec58966d Administration: Don't unnecessarily escape none or div in the admin menu.
This matches a similar conditional in `wp-admin/menu-header.php`, where these values are handled as special cases and don't output the default menu image so that an icon could be added to `div.wp-menu-image` as CSS background. 

Follow-up to [9578], [21877], [26664].

Props andrewleap, ironprogrammer, azaozz.
Fixes #58361.
Built from https://develop.svn.wordpress.org/trunk@57159


git-svn-id: http://core.svn.wordpress.org/trunk@56670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-12-05 13:39:28 +00:00
Sergey Biryukov
3546f04e16 Coding Standards: Fix a few newly introduced WPCS issues.
Follow-up to [56515], [56557], [56560].

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56598


git-svn-id: http://core.svn.wordpress.org/trunk@56110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-17 02:10:17 +00:00
Sergey Biryukov
b80ce60f70 Coding Standards: Use pre-increment/decrement for stand-alone statements.
Note: This is enforced by WPCS 3.0.0:

1. There should be no space between an increment/decrement operator and the variable it applies to.
2. Pre-increment/decrement should be favoured over post-increment/decrement for stand-alone statements. “Pre” will in/decrement and then return, “post” will return and then in/decrement. Using the “pre” version is slightly more performant and can prevent future bugs when code gets moved around.

References:
* [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#increment-decrement-operators WordPress PHP Coding Standards: Increment/decrement operators]
* [https://github.com/WordPress/WordPress-Coding-Standards/pull/2130 WPCS: PR #2130 Core: add sniffs to check formatting of increment/decrement operators]

Props jrf.
See #59161, #58831.
Built from https://develop.svn.wordpress.org/trunk@56549


git-svn-id: http://core.svn.wordpress.org/trunk@56061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-09 09:28:26 +00:00
joedolson
0aa0c763e2 Administration: Add improved context for add new links.
Consistently expand `Add New` links to include the type of content to add. Improve consistency of text casing to use initial caps throughout.

Props afercia, gonzomir, alexstine, swissspidy, joedolson.
Fixes #47125.
Built from https://develop.svn.wordpress.org/trunk@56515


git-svn-id: http://core.svn.wordpress.org/trunk@56027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-05 19:26:26 +00:00
audrasjb
888e60a012 Editor: Fix conditionals in Template Editing Mode.
Previously, Site Editor client-side routing started using only the path query argument for loading non-editor views. The router removed the `postType` query 
argument, which caused an error message to be displayed when the template parts list page was reloaded.

This changeset fixes the issue as it was affecting hybrid themes.

Props Mamaduka, isabel_brison, ramonopoly.
Fixes #58889.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-25 14:33:23 +00:00
audrasjb
6279dc749b I18N: Provide gettext context to disambiguate various translation strings.
This changeset adds context to various strings:
- `'Background'` string when referring to Custom Background appearance screens
- `'Header'` string when referring to Custom Header appearance screens
- `'General'`, `'Header'` and `'Footer'` strings when referring to template part areas

Props gonzomir, SergeyBiryukov, mukesh27, costdev, ankitmaru.
Fixes #58424.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-05 21:05:22 +00:00
Sergey Biryukov
2ec23a82ed Code Modernization: Replace usage of strpos() with str_starts_with().
`str_starts_with()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins with the given substring (needle).

WordPress core includes a polyfill for `str_starts_with()` on PHP < 8.0 as of WordPress 5.9.

This commit replaces `0 === strpos( ... )` with `str_starts_with()` in core files, making the code more readable and consistent, as well as improving performance.

While `strpos()` is slightly faster than the polyfill on PHP < 8.0, `str_starts_with()` is noticeably faster on PHP 8.0+, as it is optimized to avoid unnecessarily searching along the whole haystack if it does not find the needle.

Follow-up to [52039], [52040], [52326].

Props spacedmonkey, costdev, sabernhardt, mukesh27, desrosj, jorbin, TobiasBg, ayeshrajans, lgadzhev, SergeyBiryukov.
Fixes #58012.
Built from https://develop.svn.wordpress.org/trunk@55703


git-svn-id: http://core.svn.wordpress.org/trunk@55215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-02 15:45:22 +00:00
hellofromTonya
278725acba Site Editor: Add 'path' query arg to Appearance > Template Parts menu.
To display a list of block-based template parts for classic themes, this changeset adds a `path` query arg to the Appearance > Template Parts menu URL. This change is necessary due to recent changes to Site Editor's client-side routing.

Reference:
* [https://github.com/WordPress/gutenberg/pull/48343 Gutenberg PR 48343]
* [https://github.com/WordPress/gutenberg/pull/42729 Gutenberg PR 42729]

Follow-up to [55392], [54176].

Props mamaduka, audrasjb, fabiankaegy, hellofromTonya, kevin940726, mukesh27, youknowriad.
Fixes #57819.
Built from https://develop.svn.wordpress.org/trunk@55435


git-svn-id: http://core.svn.wordpress.org/trunk@54968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-28 15:04:23 +00:00
audrasjb
10838cb5a0 Editor: Remove "beta" label from Site Editor submenu item.
One year later, the beta phase is finally over.

Props priethor, matveb, audrasjb, hellofromtonya.
Fixes #57654.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 17:42:24 +00:00
hellofromTonya
f3ff15edfc Themes: Introduces block-based template parts for Classic themes.
Allows Classic / Hybrid themes to use block-based template parts without using complete block-based templates.

* Exposes the Site Editor's template parts UI
* Adds Appearance > "Template Parts" menu
* Enabled within the theme via adding a theme support for `'block-template-parts'`
{{{#!php
add_theme_support( 'block-template-parts' );
}}}

This is a backport from Gutenberg.[https://github.com/WordPress/gutenberg/pull/42729 See WordPress/gutenberg PR 42729].

Follow-up to [52330], [52069], [52178].

Props mamaduka, fabiankaegy, poena, scruffian, manfcarlo, bernhard-reiter, hellofromTonya.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54176


git-svn-id: http://core.svn.wordpress.org/trunk@53735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-15 12:20:09 +00:00
Andrew Ozz
136dc2b108 Site health: Add a menu bubble with the critical issues count to the Tools -> Site Health submenu.
Props: Clorith
See: #56199

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


git-svn-id: http://core.svn.wordpress.org/trunk@53724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-14 21:14:14 +00:00
Sergey Biryukov
ef7cf47ec4 Administration: Make sure the $customize_url variable is always defined in the admin menu.
This avoids an `Undefined variable` PHP warning when displaying other admin menu items.

Follow-up to [52069], [52134], [52158], [52178], [52414].

Props afragen.
Fixes #54682.
Built from https://develop.svn.wordpress.org/trunk@52415


git-svn-id: http://core.svn.wordpress.org/trunk@52007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:32:03 +00:00
hellofromTonya
673ab8a677 Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin  Editor menu item from Plugins to Tools for block themes for a consistent workflow.

Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes. 

Follow-up to [52232].

Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406


git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:06:02 +00:00
hellofromTonya
f70fb51f99 Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.
This commit renames the following method and function to better represent block theme terminology:

* `WP_Theme::is_block_based()` to `WP_Theme::is_block_theme()`
* `wp_is_block_template_theme()` to `wp_is_block_theme()`

It also changes `wp_is_block_theme()` to be a helper wrapper (sugar syntax) for `wp_get_theme()->is_block_theme();`. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

Follow-up to [52069], [52247], [52279].

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52330


git-svn-id: http://core.svn.wordpress.org/trunk@51922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 00:02:02 +00:00
noisysocks
121c824ccd Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 05:40:38 +00:00
hellofromTonya
9cf709d6b6 Administration: Restores "Customize" menu item for non-block themes and moves for block themes.
For themes without non-block themes (i.e. without a `/block-templates/index.html` file), restores the "Customize" menu item under "Appearance" menu to its original location of `6`.

For block themes, moves it to position `8`, as "Styles" is in position `7` as of [52158].

Follow-up to [29026], [52069], [52158].

Props poena, davidbaumwald, sabernhardt, hellofromTonya.
Fixes #54418.
Built from https://develop.svn.wordpress.org/trunk@52178


git-svn-id: http://core.svn.wordpress.org/trunk@51770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 04:45:00 +00:00
noisysocks
40cd53a573 Editor: Fix how the Site Editor is linked to
- Add 'Edit site' to the top admin bar.
- Link to the Template and Template Part CPTs.
- Add deep link to the Global Styles UI.

Follows [52069].
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 03:43:59 +00:00
noisysocks
c421e9b34a Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:17:17 +00:00
Sergey Biryukov
d7086ba67a Themes: Display the number of available theme updates in the admin menu.
This brings some consistency with the similar update counter for plugins.

Props mukesh27, zodiac1978, pixolin, Boniu91, francina, sannevndrmeulen, joyously, SergeyBiryukov.
Fixes #43697.
Built from https://develop.svn.wordpress.org/trunk@51022


git-svn-id: http://core.svn.wordpress.org/trunk@50631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:17:57 +00:00
Sergey Biryukov
41c9686313 Docs: Update the reference to Appearance → Theme Editor admin menu item in the inline documentation.
Follow-up to [42685].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49837


git-svn-id: http://core.svn.wordpress.org/trunk@49556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 15:46:04 +00:00
Sergey Biryukov
71dea21c5f Users: Change "Your Profile" and "My Profile" links in admin menu and toolbar to just "Profile" for consistency.
Props donmhico, bcworkz, seanchayes, mikeschroder, garrett-eclipse, akhileshsabharwal, ScottSmith, nacin, jenmylo, afercia, swissspidy, felix-edelmann, helen, melchoyce, karmatosed.
Fixes #26769.
Built from https://develop.svn.wordpress.org/trunk@47600


git-svn-id: http://core.svn.wordpress.org/trunk@47375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-20 08:39:06 +00:00
Sergey Biryukov
38676936ba Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov
cb5308b0ab Administration: Add missing description for "Page title" element of the admin menu array.
Props ajoah, valentinbora, kaitlin414.
Fixes #42911.
Built from https://develop.svn.wordpress.org/trunk@47434


git-svn-id: http://core.svn.wordpress.org/trunk@47221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-08 00:18:05 +00:00
Sergey Biryukov
63ed0401a0 Privacy: Revert [47269] for now to address side effects on Multisite installations.
See #44176.
Built from https://develop.svn.wordpress.org/trunk@47280


git-svn-id: http://core.svn.wordpress.org/trunk@47080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-11 21:48:06 +00:00
Sergey Biryukov
30c7bb621c Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:
* `erase_others_personal_data`
* `export_others_personal_data`
* `manage_privacy_options`

Previously mapped to `manage_options` or `manage_network` (on Multisite), these are now added to the Administrator role separately.

Additionally, `manage_privacy_options` is added to the Editor role.

Props garrett-eclipse, xkon, pbiron, desrosj, johnbillion, flixos90, juliobox, lakenh, Ov3rfly, ianatkins.
Fixes #44176.
Built from https://develop.svn.wordpress.org/trunk@47269


git-svn-id: http://core.svn.wordpress.org/trunk@47069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-11 18:36:06 +00:00
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
47ed56f38f 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.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa 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.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Peter Wilson
a5e57d7245 Site health: Introduce view_site_health_checks capability.
Introduces the faux primitive capability `view_site_health_checks` available to single site admins and multisite super-admin to view the site health page within the admin.

The capability is mapped to the `install_plugins` capability without being dependent on the file system being writable. This fixes a bug where the feature couldn't be used by sites unable to write to the file system or managed through version control.

The capability is granted on the `user_has_cap` filter.

Props birgire, Clorith, palmiak, peterwilsoncc, spacedmonkey.
Fixes #46957.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-10 07:42:52 +00:00
Andrew Ozz
87acdab81d Privacy tools: Organize privacy functions into logical files and classes.
Props xkon, birgire, desrosj, garrett-eclipse, azaozz.
See #43895.
Built from https://develop.svn.wordpress.org/trunk@45448


git-svn-id: http://core.svn.wordpress.org/trunk@45259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 20:50:53 +00:00
Gary Pendergast
f584cc2f67 Privacy: Remove the privacy changes bubble.
This notification was a little too intrustive, and suffered from being difficult to dismiss.

Props garrett-eclipse, xkon, ianbelanger.
Fixes #46819.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-08 23:12:51 +00:00
Gary Pendergast
0a9d61ab63 Admin: Introduce the Site Health screens.
The Site Health tool serves two purposes:
- Provide site owners with information to improve the performance, reliability, and security of their site.
- Collect comprehensive debug information about the site.

By encouraging site owners to maintain their site and adhere to modern best practices, we ultimately improve the software hygeine of both the WordPress ecosystem, and the open internet as a whole.

Props Clorith, hedgefield, melchoyce, xkon, karmatosed, jordesign, earnjam, ianbelanger, wpscholar, desrosj, pedromendonca, peterbooker, jcastaneda, garyj, soean, pento, timothyblynjacobs, zodiac1978, dgroddick, garrett-eclipse, netweb, tobifjellner, pixolin, afercia, joedolson, birgire.
See #46573.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-23 03:55:53 +00:00
Andrea Fercia
e901bc4c2b Accessibility: Improve the Comments and Privacy count text.
- standardizes the Comment count string to `%s Comment in moderation', '%s Comments in moderation` so it can be bulk-updated
- adds the string as visually hidden text in the admin menu 
- introduces an `updateInModerationText` JS simple function, responsible to correctly update all the related text using the data from the AJAX response
- adds a visually hidden text "1 Privacy Policy update" to the Privacy menu items count
- adds/improves translators comments

Changes that apply to all the count bubbles (Updates, plugins, etc.)
- makes the bubbles and their text slightly bigger
- improves the active menu item bubble contrast by changing the background color to red (option 2 in the screenshot attached in a previous comment)

Props adamsoucie, afercia.
Fixes #33030.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-18 15:22:53 +00:00
iandunn
8af721fff8 Privacy: Replace intrusive policy update notice with menu bubbles.
Previously, when a plugin updated its suggested privacy policy text, an admin notice was shown on all screens in the Administration Panels. That was done in order to make sure that administrators were aware of it, so that they could update their policy if needed. That was a very heavy-handed and intrusive approach, though, which leads to a poor user experience, and notice fatigue. 

An alternative approach is to use bubble notifications in the menu, similar to when plugins have updates that need to be installed. That still makes it obvious that something needs the administrator's attention, but is not as distracting as a notice.

The notice will still appear on the Privacy page, though, since it is relevant to that screen, and provides an explanation of why the bubble is appearing.

Props azaozz, xkon, iandunn.
Fixes #43954. See #43953.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-10 19:52:21 +00:00
Andrew Ozz
fbc98b8e75 Privacy: rename manage_privacy_policy to manage_privacy_options.
Props desrosj.
FIxes #43935.
Built from https://develop.svn.wordpress.org/trunk@43155


git-svn-id: http://core.svn.wordpress.org/trunk@42984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-03 19:31:21 +00:00
iandunn
9faae413dc Privacy: Limit Privacy Settings screen to Super Admins in Multisite.
In many common Multisite use cases, the network administrator will want to set a network-wide privacy policy -- via the `privacy_policy_url` filter -- for consistency and convenience. When that's done, the Privacy Settings screen on individual sites becomes unnecessary, and may confuse administrators of those sites when they see that their changes don't have any effect on the policy link in the footer.

Since we can't programatically determine which behavior the network admins would like, the safest default setting is to restrict the ability to super admins, and let them delegate it to individual site owners via a plugin, if they'd like to.

Fixes #43935.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-03 17:25:21 +00:00
iandunn
cd3ea58832 Privacy: Move privacy policy page to Settings menu for consistency.
The page was originally placed under `Tools` so that it would be grouped with the pages to export and erase personal data, since they're all part of the effort to bring privacy management tools to Core ahead of GDPR's deadline. After more consideration, though, it makes sense to move this page to the `Settings` menu, since it's fundamental purpose is to configure an option, rather than to facilitate a recurring task. This keeps all of the configuration pages in a single place, making them consistent and easier to find.

Exporting and erasing personal data are recurring tasks, so they still make sense under the `Tools` menu.

Props xkon, helen, melchoyce, allendav, desrosj, ocean90, azaozz.
Fixes #43873.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-03 16:41:22 +00:00
Andrew Ozz
b93dfd3571 Add Privacy Tools admin page under the Tools menu.
Props allendav, xkon, azaozz.
See #43435.
Built from https://develop.svn.wordpress.org/trunk@42814


git-svn-id: http://core.svn.wordpress.org/trunk@42644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-09 15:04:33 +00:00
Sergey Biryukov
b1f48870d7 Administration: Rename Appearance → Editor menu item to Theme Editor and Plugins → Editor to Plugin Editor for clarity.
Props xkon, karmatosed.
Fixes #43072.
Built from https://develop.svn.wordpress.org/trunk@42685


git-svn-id: http://core.svn.wordpress.org/trunk@42513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-10 08:43:32 +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
Felix Arntz
f6ebc1a80c 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-18 18:31:44 +00:00
Felix Arntz
00e8704288 Multisite: Introduce a setup_network capability for setting up multisite.
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check.

Props ashokkumar24 for the original patch.
Fixes #39206. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 12:53:45 +00:00
Weston Ruter
84ed6f665f Customize: Prevent links to customize.php from being generated which have query vars from wp_removable_query_args() present.
Props dlh.
See #23367, #32692.
Fixes #31850.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-22 23:04:42 +00:00
Felix Arntz
da4cc4d9e2 Multisite: Replace is_super_admin() with update_core for update permissions.
Fixes #39060. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-07 22:14:42 +00:00
Pascal Birchler
e4d7dd2b8a Upgrade/Install: Refresh update counts after page load.
By enqueuing the updates script in the footer and passing the number of available updates to it after page load, the update bubbles will be more accurate.

Props ocean90, swissspidy.
Fixes #13071.
Built from https://develop.svn.wordpress.org/trunk@38827


git-svn-id: http://core.svn.wordpress.org/trunk@38770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 10:27:29 +00:00
Drew Jaynes
b1804afeaf Docs: Standardize on 'backward compatibility/compatible' nomenclature in core inline docs.
Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-13 18:41:31 +00:00
Drew Jaynes
9351a7c9ff Docs: Add a missing DocBlock for the private _add_themes_utility_last() function.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-03 20:07:27 +00:00