Commit Graph

647 Commits

Author SHA1 Message Date
Sergey Biryukov
0cc6547e43 Docs: Adjust get_post_modified_time filter DocBlock for consistency with get_post_time.
See #47110.
Built from https://develop.svn.wordpress.org/trunk@45380


git-svn-id: http://core.svn.wordpress.org/trunk@45191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-23 00:41:51 +00:00
Sergey Biryukov
3c16bdc538 Date/Time: Return early from the_weekday() and the_weekday_date() if we're not in the loop.
Restore `$previousweekday` global usage in `the_weekday_date()`, so it could still be used simultaneously with `the_date()`.

Partially reverts [45378].
See #47354.
Built from https://develop.svn.wordpress.org/trunk@45379


git-svn-id: http://core.svn.wordpress.org/trunk@45190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-23 00:38:52 +00:00
Sergey Biryukov
ed08643734 Date/Time: Bring some consistency to the_date() and the_weekday_date():
* Make `the_date()` always apply the the filter and return a value.
* Use `is_new_day()` in `the_weekday_date()`.
* Add a unit test for `the_weekday_date()`.

Fixes #47354.
Built from https://develop.svn.wordpress.org/trunk@45378


git-svn-id: http://core.svn.wordpress.org/trunk@45189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-22 21:58:50 +00:00
Sergey Biryukov
0b66be9cd7 Docs: Improve documentation for the_date() and the_weekday_date().
Correct type for `$currentday` and `$previousday` globals.

See #47354, #47110.
Built from https://develop.svn.wordpress.org/trunk@45377


git-svn-id: http://core.svn.wordpress.org/trunk@45188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-22 21:48:52 +00:00
Sergey Biryukov
e06afa8a80 Accessibility: In back-compat code added for get_search_form() in [44956], when checking the (previously boolean) $args value, account for non-strict comparison.
Props dkarfa, sachyya-sachet.
Fixes #47177. See #42057.
Built from https://develop.svn.wordpress.org/trunk@45340


git-svn-id: http://core.svn.wordpress.org/trunk@45151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-17 02:22:53 +00:00
Gary Pendergast
a125989772 Emoji: Update Twemoji to version 12.0.0.
Props pento, superpoincare.
Fixes #46404, #46805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-08 05:22:51 +00:00
John Blackbourn
94e4da6aec Themes: Introduce a generic action that's fired when a template part is loaded.
This action allows debugging mechanisms to perform greater introspection into which template parts are loaded for any given request. It also exposes the array of candidate template part file names for each template part instance.

Props pcfreak30, jdeeburke

Fixes #41575

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


git-svn-id: http://core.svn.wordpress.org/trunk@44868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-28 21:13:54 +00:00
Adam Silverstein
418afaa938 Bundled Theme: trigger a new wp_body_open action immediately after the opening body tag.
* Enables inserting (asynchronous) JavaScript right after the opening `body` tag.
* Add a `wp_body_open` helper function that triggers the `wp_body_open` action.
* Call `wp_body_open` in core themes immediately after the opening `body` tag.

Props joostdevalk, valendesigns, nacin, saracup, jorbin, mikeschinkel, jonnybojangles, lgedeon, Willscrlt, Denis-de-Bernardy, lexiqueen, sky_76, welcher, westonruter, ramiy, joyously.
Fixes #12563.

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


git-svn-id: http://core.svn.wordpress.org/trunk@44851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 21:59:52 +00:00
Sergey Biryukov
d4d906c4d5 Themes: Remove itemprop="url" from get_custom_logo() output.
Making incorrect assumptions about microdata used in a theme results in invalid markup.

The attribute can still be added using the `get_custom_logo` or `wp_get_attachment_image_attributes` filter, but it should not be added by default.

Props henry.wright, tfrommen, afercia, markcallen, zodiac1978.
Fixes #37305.
Built from https://develop.svn.wordpress.org/trunk@45028


git-svn-id: http://core.svn.wordpress.org/trunk@44837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 12:16:53 +00:00
Sergey Biryukov
eb5c0abc00 Accessibility: Add ability to pass an ARIA label for the <form> element returned by get_search_form().
This allows screen readers to properly announce each search landmark region independently.

Introduce `search_form_args` filter for the arguments used when generating the search form.

Props afercia, williampatton.
Fixes #42057.
Built from https://develop.svn.wordpress.org/trunk@44956


git-svn-id: http://core.svn.wordpress.org/trunk@44787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-21 09:20:59 +00:00
Sergey Biryukov
2922b9b1b4 Docs: Add a @since tag for the new $selected parameter of get_archives_link().
See #40662.
Built from https://develop.svn.wordpress.org/trunk@44898


git-svn-id: http://core.svn.wordpress.org/trunk@44729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-14 19:37:51 +00:00
Sergey Biryukov
bba488f2b7 Widgets: Pre-select currently viewed archive in the Archives dropdown widget, for consistency with the Categories widget.
Props robobot3000, audrasjb, afercia, Themonic.
Fixes #40662.
Built from https://develop.svn.wordpress.org/trunk@44897


git-svn-id: http://core.svn.wordpress.org/trunk@44728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-14 19:31:49 +00:00
Sergey Biryukov
5658305b1c Date/Time: Reduce explicit local current_time( 'timestamp' ) usage in favor of native PHP functions.
Timestamps don't carry any timezone information, using the intended format directly simplifies the logic and makes the code less confusing.

Props Rarst, jdgrimes.
See #40657.
Built from https://develop.svn.wordpress.org/trunk@44809


git-svn-id: http://core.svn.wordpress.org/trunk@44641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-07 09:12:51 +00:00
desrosj
2d1d80f4c5 Themes: Revert returning the value of locate_template() in functions that call it.
Because the names of the `get_header()`, `get_footer()`, `get_sidebar()`, and `get_template_part()` functions indicate that a value is returned, some plugins and themes already have `echo get_template_part()` in their codebase. Adding a return value to these functions using the approach in [44678] will cause the two unintended side effects of unexpected content being sent to the browser, and accidental path disclosure.

Reverts [44678].

Props davidbinda.
See #40969.
Built from https://develop.svn.wordpress.org/trunk@44725


git-svn-id: http://core.svn.wordpress.org/trunk@44556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-06 18:37:51 +00:00
Gary Pendergast
57c293e2d7 Themes: Return the value of locate_template() in functions that call it.
The `get_header()`, `get_footer()`, `get_sidebar()`, and `get_template_part()` functions all call `locate_template()` as their final action, which returns the name of the template being loaded. Returning this value helps handle problems with templates being loaded.

Props tferry.
Fixes #40969.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-21 22:00:50 +00:00
Gary Pendergast
0ee053758e Emoji: Upgrade Twemoji to 11.2.0.
This upgrade includes general improvements to the style of a variety of emoji.

Full changelog: https://github.com/twitter/twemoji/compare/v11.0.0...v11.2.0

Props desrosj, pento.
Fixes #45133.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-18 01:42:50 +00:00
Gary Pendergast
e96ea8eab6 Docs: Partial revert of [44636].
Unrelated changes in `wp-includes/general-template.php` were accidentally committed.

See #44502.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 07:57:52 +00:00
Gary Pendergast
e42dddb5ba Docs: Mark the internal functions as @private in wp-includes/post.php.
Props shamim51.
Fixes #44502.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 07:21:51 +00:00
Gary Pendergast
dcdfd7f412 Docs: Fix the last handful of incorrect @since 5.0.0 docblock tags.
Props peterwilsoncc.
Fixes #45543.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-17 06:46:50 +00:00
desrosj
34c4ce3c81 Docs: Update inaccurate return descriptions.
In the `@return` tag description for `get_post_modified_time()`, `get_the_time()`, and `get_post_time()`, the `$d` parameter is incorrectly referred to as `$id`.

Props behzod.
Fixes #45323.
Built from https://develop.svn.wordpress.org/trunk@44592


git-svn-id: http://core.svn.wordpress.org/trunk@44423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 02:08:49 +00:00
Gary Pendergast
4f861b9548 Coding Standards: Fix the Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace violations.
See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:40:50 +00:00
Gary Pendergast
6d5cd6842a Coding Standards: Document intentional case block fall-throughs.
Fixes `PSR2.ControlStructures.SwitchDeclaration.TerminatingComment` violations.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:26:50 +00:00
desrosj
4818f7e3f7 Administration: Update default fallback color for SVG icons.
Currently, when an SVG is used as a menu icon, the color is inconsistent with the other, default dashicons and the contrast ratio does not meet the minimum requirement for accessibility.

This updates the base color for the default `fresh` color scheme to ensure consistency and proper contrast.

Props swift, dschalk.
Fixes #44209.
Built from https://develop.svn.wordpress.org/trunk@44353


git-svn-id: http://core.svn.wordpress.org/trunk@44183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-20 19:01:48 +00:00
Jeremy Felt
f93e24ca8e REST API: Render response in user locale with ?_locale=user.
Introduces new `determine_locale()` function for deciding the proper locale to use for a response. Default value is `get_user_locale()` in the admin, and `get_locale()` on the frontend. Because REST API requests are considered frontend requests, `?_locale=user` can be used to render the response in the user's locale.

Also updates `wp-login.php?wp_lang` implementation to benefit from this abstraction.

Merges [43776] from the 5.0 branch to trunk.

Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
Fixes #44758.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 01:32:39 +00:00
desrosj
cf6e69ee9f General: Extract the code editor settings from wp_enqueue_code_editor().
They're now returned by a new function, `wp_get_code_editor_settings()`, so they can be reused by the block editor.

Props pento.

Merges [43761] to trunk.

Fixes #45127.
Built from https://develop.svn.wordpress.org/trunk@44121


git-svn-id: http://core.svn.wordpress.org/trunk@43951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 22:24:33 +00:00
Peter Wilson
481e5f4b36 Multisite: Improve messaging for previously activated users.
Ensure activation of a site is not attempted multiple times and users are shown the correct message if they follow the link a second time.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 00:23:24 +00:00
Sergey Biryukov
dafee9fae6 Date/Time: Make get_the_date() call get_post_time() for consistency with get_the_time().
Props Rarst.
Fixes #44490.
Built from https://develop.svn.wordpress.org/trunk@43591


git-svn-id: http://core.svn.wordpress.org/trunk@43420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-30 08:50:24 +00:00
John Blackbourn
47d32decd6 Docs: Correct and improve various inline documentation.
See #42505

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


git-svn-id: http://core.svn.wordpress.org/trunk@43411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-27 14:28:26 +00:00
Gary Pendergast
56c162fbc9 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Gary Pendergast
0db068da94 Emoji: Update Twemoji to version 11.0.
{U+01F9B9}

Props kraftbj,
Fixes #44339.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:42:55 +00:00
Dominik Schilling
31a4369366 Template: Make sure the version string is correctly escaped for use in attributes.
Built from https://develop.svn.wordpress.org/trunk@42893


git-svn-id: http://core.svn.wordpress.org/trunk@42723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-03 14:59:31 +00:00
Dominik Schilling
5c291d49de Pinking shears.
See #41057.
Built from https://develop.svn.wordpress.org/trunk@42843


git-svn-id: http://core.svn.wordpress.org/trunk@42673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-18 14:23:33 +00:00
Sergey Biryukov
4848a09b35 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.
Built from https://develop.svn.wordpress.org/trunk@42827


git-svn-id: http://core.svn.wordpress.org/trunk@42657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-11 16:44:34 +00:00
Sergey Biryukov
b0ddd7ca43 Docs: Add description for register_admin_color_schemes().
Props terriann, danieltj.
Fixes #42779.
Built from https://develop.svn.wordpress.org/trunk@42765


git-svn-id: http://core.svn.wordpress.org/trunk@42595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-28 03:28:31 +00:00
Sergey Biryukov
0a97d79899 Comments: Avoid a PHP notice in paginate_comments_links() if type argument is set to array.
The function is a wrapper for `paginate_links()`, which returns an array if requested.

Props anantajitjg.
Fixes #43299.
Built from https://develop.svn.wordpress.org/trunk@42703


git-svn-id: http://core.svn.wordpress.org/trunk@42531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-12 21:12:35 +00:00
Drew Jaynes
39ce01d83a Docs: Fix a typo in the DocBlock description for get_bloginfo() illustrating the URL structure for RDF feeds.
Props ibachal.
See #42505.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-07 19:42:30 +00:00
Sergey Biryukov
76ad62d11e Code Editor: Add Ctrl/Cmd+F as aliases for persistent search for more intuitive behaviour.
Keep Alt+F as well for users who already expect that.

Props Desertsnowman.
See #42586.
Built from https://develop.svn.wordpress.org/trunk@42625


git-svn-id: http://core.svn.wordpress.org/trunk@42454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-31 22:22:30 +00:00
Sergey Biryukov
ee58ffcbe7 Emoji: Update emoji base URL in _print_emoji_detection_script() and wp_staticize_emoji().
Props pento.
Fixes #42862.
Built from https://develop.svn.wordpress.org/trunk@42590


git-svn-id: http://core.svn.wordpress.org/trunk@42419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-24 16:51:30 +00:00
Weston Ruter
11af5ae5cd Code Editor: Disable attr-value-double-quotes HTMLHint rule since too strict for user input.
Using single-quoted attribute values is not in any way invalid HTML.

Amends [41376].
Props sasiddiqui.
See #12423.
Fixes #42802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-21 08:01:31 +00:00
Andrew Ozz
365025fb62 Editor: change the test in user_can_richedit() to also detect when IE11 is in compatibility mode.
Props ndavison, azaozz.
Fixes #42503 for trunk.
Built from https://develop.svn.wordpress.org/trunk@42529


git-svn-id: http://core.svn.wordpress.org/trunk@42358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-18 14:43:31 +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
John Blackbourn
3713ac5ebc Hardening: Add escaping to the language attributes used on html elements.
Built from https://develop.svn.wordpress.org/trunk@42259


git-svn-id: http://core.svn.wordpress.org/trunk@42088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-29 15:55:47 +00:00
Gary Pendergast
c90cfa3b50 General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
John Blackbourn
8c7bb9009c Users: Correct the value of the lang attribute in the admin area.
This corrects the value when the user's language is set to `English (United States)` but the site language is not.

Props ocean90, afercia

Fixes #42242

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


git-svn-id: http://core.svn.wordpress.org/trunk@42049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 19:04:46 +00:00
Weston Ruter
226263bfec Code Editor: Define default gutters and toggle lint markers based on changes to lint option.
Explicitly define `gutters` in base `defaultSettings` to improve merges of multiple calls to `wp_enqueue_code_editor()`.

Props westonruter, georgestephanis for testing.
Amends [41974].
See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 16:35:54 +00:00
Weston Ruter
0343b1a2c8 Code Editor: Keep linting and its error reporting configured when lint option is changed dynamically.
Also explicitly disable `lint` option for SCSS and LESS.

See #12423.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 19:55:46 +00:00
Sergey Biryukov
e29c2f560b Template: Introduce readonly() form helper to complement the disabled() helper added in [13658].
Props soulseekah.
Fixes #16886.
Built from https://develop.svn.wordpress.org/trunk@41728


git-svn-id: http://core.svn.wordpress.org/trunk@41562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:19:48 +00:00
Weston Ruter
f0b5c39bde Customize: Introduce extensible code editor Customizer control for CodeMirror.
* Adds `WP_Customize_Code_Editor_Control` and `wp.customize.CodeEditorControl()`.
* Control respects user preference for syntax highlighting, showing a textarea when user opts out.
* Code editor control takes the ad hoc code for Additional CSS and makes it reusable and extensible, for Additional CSS in core and plugins to use (such as Jetpack).
* Replace `settings` arg in `wp_enqueue_code_editor()` with separate args for `codemirror`, `csslint`, `jshint`, and `htmlhint`.
* Prefix `codemirror` script and style handles with `wp-` to prevent collisions, as also the object is exported as `wp.CodeMirror` in JS.
* Reduce indent size in Customizer code editor instances and Custom HTML widget to use tab size of 2 instead of 4 to save on space.

See #12423, #38707, #35395.
Fixes #41897.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 23:04:45 +00:00
Weston Ruter
90bedf8f9d Editor: Add CodeMirror-powered code editor with syntax highlighting, linting, and auto-completion.
* Code editor is integrated into the Theme/Plugin Editor, Additional CSS in Customizer, and Custom HTML widget. Code editor is not yet integrated into the post editor, and it may not be until accessibility concerns are addressed.
* The CodeMirror component in the Custom HTML widget is integrated in a similar way to TinyMCE being integrated into the Text widget, adopting the same approach for integrating dynamic JavaScript-initialized fields.
* Linting is performed for JS, CSS, HTML, and JSON via JSHint, CSSLint, HTMLHint, and JSONLint respectively. Linting is not yet supported for PHP.
* When user lacks `unfiltered_html` the capability, the Custom HTML widget will report any Kses-invalid elements and attributes as errors via a custom Kses rule for HTMLHint.
* When linting errors are detected, the user will be prevented from saving the code until the errors are fixed, reducing instances of broken websites.
* The placeholder value is removed from Custom CSS in favor of a fleshed-out section description which now auto-expands when the CSS field is empty. See #39892.
* The CodeMirror library is included as `wp.CodeMirror` to prevent conflicts with any existing `CodeMirror` global.
* An `wp.codeEditor.initialize()` API in JS is provided to convert a `textarea` into CodeMirror, with a `wp_enqueue_code_editor()` function in PHP to manage enqueueing the assets and settings needed to edit a given type of code.
* A user preference is added to manage whether or not "syntax highlighting" is enabled. The feature is opt-out, being enabled by default.
* Allowed file extensions in the theme and plugin editors have been updated to include formats which CodeMirror has modes for: `conf`, `css`, `diff`, `patch`, `html`, `htm`, `http`, `js`, `json`, `jsx`, `less`, `md`, `php`, `phtml`, `php3`, `php4`, `php5`, `php7`, `phps`, `scss`, `sass`, `sh`, `bash`, `sql`, `svg`, `xml`, `yml`, `yaml`, `txt`.

Props westonruter, georgestephanis, obenland, melchoyce, pixolin, mizejewski, michelleweber, afercia, grahamarmfield, samikeijonen, rianrietveld, iseulde.
See #38707.
Fixes #12423, #39892.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-13 06:08:47 +00:00
Andrea Fercia
6fc55cad3a Allow usage of aria-current in paginate_links().
The `aria-current` attribute is a simple, effective way to help assistive
technology users orientate themselves within a list of items.

Props GrahamArmfield, palmiak.
Fixes #40833.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-11 14:29:44 +00:00