Commit Graph

270 Commits

Author SHA1 Message Date
Andrew Ozz
f979e79d54 TinyMCE: Fix the keyboard shortcut (Alt+Shift+H) to not open the default Block Editor help modal and change the title of the help modal to "Classic Block Keyboard Shortcuts" in the Classic BLock. Also remove Alt+Shift+Z in the Classic Block as it conflicts with the Block Editor.
Fixes #45365.
Built from https://develop.svn.wordpress.org/branches/5.0@43915


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-11-21 12:28:48 +00:00
Gary Pendergast
dbb5cd9960 Classic Editor: Disable the wpautop TinyMCE plugin on block posts.
As the block editor adds its own `<p>` tags, disabling the wpautop stops the classic editor from removing them.

See #45113.


Built from https://develop.svn.wordpress.org/branches/5.0@43758


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 01:43:26 +00:00
atimmer
72c9037248 Script loading: Fix a PHP error introduced in [43753].
See #45065.
Props swissspidy.

Built from https://develop.svn.wordpress.org/branches/5.0@43754


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 13:27:26 +00:00
atimmer
ab6b171b1d Script loading: Fix regression after [43738].
After [43738], TinyMCE would be loaded earlier than before, which
makes filters run at a different time relative to the loading of
TinyMCE. Fix this by calling `wp_print_scripts` at the location where
TinyMCE would previously be inserted as a `<script>` tag in the page.

Props azaozz, omarreiss.
Fixes #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43753


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 13:22:26 +00:00
atimmer
07ea394b44 Script loader: Adjust JS packages registration.
Adjusts the packages registration after [43723]:

* Combine the different registration functions into one
`wp_default_packages` function. To reach this goal move the prefix
logic into a function so it can be called from different locations.
Use a `static` variable there to prevent duplicate inclusion of
`version.php`.
* Call this function from the `wp_default_scripts` action by
registering it as a default filter.
* Combine some of the logic in `_WP_Editors::print_tinymce_scripts`
into `wp_register_tinymce_scripts`. The logic to force an uncompressed
TinyMCE script file stays in `_WP_Editors::force_uncompressed_tinymce`
because that logic is very specific to the classic editor.
* The script handle `wp-tinymce` is now a dependency of the `editor`
script handle. In combination with the previous item, this makes the
classic editor work.
* Adjust the syntax of the script paths to be more consistent with
other WordPress code.
* Always use `"production"` mode for the media files to prevent people
from inadvertently committing development files.

Props pento, omarreiss.
Fixes #45065.

Built from https://develop.svn.wordpress.org/branches/5.0@43738


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-17 15:29:26 +00:00
Sergey Biryukov
ec980c34e0 Editor: Use apply_filters_deprecated() for some deprecated filters.
The `htmledit_pre` and `richedit_pre` filters have been deprecated since 4.3.0, since before `apply_filters_deprecated()` existed. They're now correctly run using `apply_filters_deprecated()`.

Props sebastienthivinfocom, lbenicio, ianbelanger.
Merges [43464] to the 4.9 branch.
Fixes #44341.
Built from https://develop.svn.wordpress.org/branches/4.9@43482


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 15:05:25 +00:00
Andrew Ozz
249407985c TinyMCE: do not force-load external plugins, not needed any more and may cause issues.
Merges [43337] to the 4.9 branch.
Fixes #44330.
Built from https://develop.svn.wordpress.org/branches/4.9@43474


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-17 10:09:24 +00:00
Andrew Ozz
8e660e35d1 TinyMCE: switch off concatenation when a custom TinyMCE theme is used. Prevents conflict with the default theme as it loads first.
Props programmin, azaozz.
Merges [43222] to the 4.9 branch.
Fixes #43969.
Built from https://develop.svn.wordpress.org/branches/4.9@43224


git-svn-id: http://core.svn.wordpress.org/branches/4.9@43053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-10 19:54:25 +00:00
Sergey Biryukov
0fc7597032 Docs: Document $default_scripts parameter in _WP_Editors::enqueue_scripts().
Props danieltj, ajayghaghretiya1.
Fixes #41322.
Built from https://develop.svn.wordpress.org/trunk@41917


git-svn-id: http://core.svn.wordpress.org/trunk@41751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 18:09:47 +00:00
Mel Choyce
e8922f416e TinyMCE: Remove "Unlink" icon from toolbar
Because "unlink" now appears contextually when editing a link, let's remove it from the toolbar.

Props azaozz, ahortin, swissspidy, afercia.
Fixes #36569.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 19:14:46 +00:00
Andrew Ozz
765272e3e5 Editor:
- Fix keeping text selection and scroll position when there are embeds from URL.
- Add editor setting to disable keeping selection and scroll position.
- Remove dependency on Underscore.js.
- Fix error in the Text widget editor.

Props biskobe.
Fixes #42059, see #40854.
Built from https://develop.svn.wordpress.org/trunk@41783


git-svn-id: http://core.svn.wordpress.org/trunk@41617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-06 17:44:48 +00:00
Pascal Birchler
078a63e049 Editor: In _WP_Editors::wp_link_query, allow filtering empty results.
Previously, it was not possible to hook into the `wp_link_query` filter to add custom entries when the 
query returned no posts.

Props mitraval192, msebel.
Fixes #41825.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-08 14:03:44 +00:00
Sergey Biryukov
760d2b3771 I18N: Use a consistent context for Visual and Text editor tab labels.
Props pedromendonca.
Fixes #41438.
Built from https://develop.svn.wordpress.org/trunk@41152


git-svn-id: http://core.svn.wordpress.org/trunk@40992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 22:58:41 +00:00
Sergey Biryukov
4e4df0e6c9 Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.8.0 entries.
See #41017.
Built from https://develop.svn.wordpress.org/trunk@41151


git-svn-id: http://core.svn.wordpress.org/trunk@40991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-25 22:48:42 +00:00
Sergey Biryukov
e42553dbea Docs: Add a @global entry for $tinymce_version in _WP_Editors::editor_js().
Props jontyravi.
Fixes #41311.
Built from https://develop.svn.wordpress.org/trunk@41040


git-svn-id: http://core.svn.wordpress.org/trunk@40890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-13 14:33:40 +00:00
Sergey Biryukov
6b0c0592de Docs: Update the DocBlock for _WP_Editors::wp_fullscreen_html() after [32677].
See #30949.
Built from https://develop.svn.wordpress.org/trunk@41015


git-svn-id: http://core.svn.wordpress.org/trunk@40865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-06 23:44:40 +00:00
Sergey Biryukov
2ca39ce60d Docs: Add a @global entry for $tinymce_version in _WP_Editors::default_settings().
Props tejas5989.
Fixes #41244.
Built from https://develop.svn.wordpress.org/trunk@41007


git-svn-id: http://core.svn.wordpress.org/trunk@40857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-05 18:55:44 +00:00
Andrew Ozz
65f1051697 TinyMCE: respect the Disable the visual editor when writing user setting and don't output the TinyMCE components when using wp_enqueue_editor().
Fixes #40960 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40991


git-svn-id: http://core.svn.wordpress.org/trunk@40841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 21:31:47 +00:00
Andrew Ozz
7f6ae69843 TinyMCE: fix directionality settings for RTL languages.
Props westonruter, sa3idho.
Fixes #40972 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40927


git-svn-id: http://core.svn.wordpress.org/trunk@40777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-24 09:19:43 +00:00
Sergey Biryukov
d14cc278ff Editor: Correct $settings parameter description in _WP_Editors::editor().
Props truongwp.
Fixes #40963.
Built from https://develop.svn.wordpress.org/trunk@40910


git-svn-id: http://core.svn.wordpress.org/trunk@40760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-15 12:19:40 +00:00
Andrew Ozz
56101fc06a TinyMCE: Force urlencoding of commas in URLs added by plugins to prevent warnings about missing stylesheets.
Fixes #40893.
Built from https://develop.svn.wordpress.org/trunk@40862


git-svn-id: http://core.svn.wordpress.org/trunk@40712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-31 22:04:43 +00:00
Andrew Ozz
dd0d110520 TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.
Fixes #40690.
Built from https://develop.svn.wordpress.org/trunk@40583


git-svn-id: http://core.svn.wordpress.org/trunk@40453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-08 05:32:46 +00:00
Andrew Ozz
c7058c739d Editor: fix undefined var notice in editor_js() in class-wp-editor.php.
Props littler.chicken.
Fixes #40501, see #35760.
Built from https://develop.svn.wordpress.org/trunk@40515


git-svn-id: http://core.svn.wordpress.org/trunk@40391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 01:12:44 +00:00
Sergey Biryukov
ebf0b9e46e Editor: Define $suffix before using it in _WP_Editors::print_tinymce_scripts().
Props imath.
Fixes #40479. See #35760.
Built from https://develop.svn.wordpress.org/trunk@40477


git-svn-id: http://core.svn.wordpress.org/trunk@40353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 12:02:46 +00:00
Andrew Ozz
d0e4448257 Editor: Provide API for the editor to be dynamically instantiated via JS. First run.
See: #35760
Built from https://develop.svn.wordpress.org/trunk@40476


git-svn-id: http://core.svn.wordpress.org/trunk@40352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 02:38:44 +00:00
Andrew Ozz
69c29935d5 TinyMCE: improve the previews for embedded WordPress posts:
- Add option to force a sandbox iframe in wpview.
- Use it to show the embedded post preview.
- Remove the deprecated `wpembed` plugin.js

Fixes #39513.
Built from https://develop.svn.wordpress.org/trunk@40019


git-svn-id: http://core.svn.wordpress.org/trunk@39956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-27 04:25:44 +00:00
Andrew Ozz
e2166de4b0 Always add page-template-default class to the editor body when the template is not specified. This matches the behavior on the front-end.
Props timph (for the detailed bug report), azaozz.
Fixes #39368 for trunk.
Built from https://develop.svn.wordpress.org/trunk@39678


git-svn-id: http://core.svn.wordpress.org/trunk@39618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 01:53:43 +00:00
Andrew Ozz
95720f3b7c TinyMCE: after chats in #core-editor and #desing on Slack, the decision is to not remove Heading 1 for beta1.
See #38049.
Built from https://develop.svn.wordpress.org/trunk@38970


git-svn-id: http://core.svn.wordpress.org/trunk@38913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:01:33 +00:00
Andrew Ozz
11e7d3d250 TinyMCE: revert removing the numbers (2-6) after the headings in the drop-down. Seems it causes more confusion.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38946


git-svn-id: http://core.svn.wordpress.org/trunk@38889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:16:30 +00:00
Andrew Ozz
ed2e427b9d TinyMCE: remove the numbers (2-6) after the headings in the drop-down. These are previews for the actual styling of headings in the editor.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38939


git-svn-id: http://core.svn.wordpress.org/trunk@38882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:42:48 +00:00
Andrew Ozz
e1ae827577 TinyMCE: remove and rearrange some of the editor buttons to improve user experience.
Props hugobaeta, melchoyce, celloexpressions, mor10, iseulde, mrwweb.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38932


git-svn-id: http://core.svn.wordpress.org/trunk@38875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:51:36 +00:00
Andrew Ozz
913926c1bd TinyMCE: make keyboard shortcuts more discoverable by adding them to the buttons tooltips and in the Formats drop-down.
Props mor10, azaozz.
Fixes #38063.
Built from https://develop.svn.wordpress.org/trunk@38897


git-svn-id: http://core.svn.wordpress.org/trunk@38840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 01:40:31 +00:00
Andrew Ozz
4996d05355 TinyMCE:
- When editing pages, add body class with the page template, or `page-template-default`.
- Change the page template class when the users select another template, similarly to changing the post type class for posts.

Props webmandesign.
Fixes #37599.
Built from https://develop.svn.wordpress.org/trunk@38803


git-svn-id: http://core.svn.wordpress.org/trunk@38746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 01:10:28 +00:00
Andrew Ozz
cb966db094 TiinyMCE: update to 4.4.3, changelog: https://www.tinymce.com/docs/changelog/#version443-september12016
Fixes #38081, #38245, #37507, #37808 and #38000.
Built from https://develop.svn.wordpress.org/trunk@38773


git-svn-id: http://core.svn.wordpress.org/trunk@38716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 00:10:32 +00:00
Pascal Birchler
4a88d55054 I18N: Introduce a user-specific language setting.
By enabling the user to select their preferred locale when editing the profile, we allow for greater personalization of the WordPress admin and therefore a better user experience.

The back end will be displayed in the user's individual locale while the locale used on the front end equals the one set for the whole site. If the user didn't specify a locale, the site's locale will be used as a fallback. The new `locale` property of the `WP_User` class can be used to retrieve the user's locale setting.

Props ocean90, ipm-frommen, swissspidy.
Fixes #29783.
Built from https://develop.svn.wordpress.org/trunk@38705


git-svn-id: http://core.svn.wordpress.org/trunk@38648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 07:04:29 +00:00
Scott Taylor
9383bf8f74 General: use get_bloginfo( 'version' ) instead of global $wp_version in several locations - excluding those locations which reload version.php mid-flight.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:49:37 +00:00
Andrew Ozz
15edc78f6f TinyMCE: fix toolbars alignment in RTL.
Fixes #37760 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38349


git-svn-id: http://core.svn.wordpress.org/trunk@38290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-25 01:20:30 +00:00
Andrew Ozz
5bccb0020d TinyMCE, inline link:
- Remove proxying through WordPress to test if an URL exists.
- Fix and enhance the regex that tests if the URL is well formed.

Fixes #36638.
Built from https://develop.svn.wordpress.org/trunk@38159


git-svn-id: http://core.svn.wordpress.org/trunk@38100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-26 23:24:28 +00:00
Andrew Ozz
04319a7898 TinyMCE, link check:
- Use `wp.a11y.speak()` to announce bad URLs.
- Do not add a title to the link toolbar.
- Better error message.

Props afercia, azaozz.
See #36638.
Built from https://develop.svn.wordpress.org/trunk@38126


git-svn-id: http://core.svn.wordpress.org/trunk@38067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-21 03:42:34 +00:00
Andrew Ozz
ba81f46c64 TinyMCE: replace the editor iframe title on MacOS to fix the help shortcut.
Props afercia, azaozz.
Fixes #36863.
Built from https://develop.svn.wordpress.org/trunk@38110


git-svn-id: http://core.svn.wordpress.org/trunk@38051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-20 01:39:31 +00:00
Dominik Schilling
94d344829e Editor: Enqueue the wp-embed script to fix embed previews inside the media modal.
Props swissspidy.
Fixes #37334.
Built from https://develop.svn.wordpress.org/trunk@38062


git-svn-id: http://core.svn.wordpress.org/trunk@38003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-14 13:29:31 +00:00
Sergey Biryukov
139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong(), _deprecated_function(), _deprecated_argument(), and _deprecated_file() throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Andrew Ozz
accf240d37 Editor: after inserting a link detect if the URL is broken, first run.
Props iseulde, azaozz.
See #36638.
Built from https://develop.svn.wordpress.org/trunk@37741


git-svn-id: http://core.svn.wordpress.org/trunk@37706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-17 20:41:28 +00:00
Drew Jaynes
602b51a209 Docs: Standardize filter docs in core classes in wp-includes/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:15:28 +00:00
Dominik Schilling
693dfe3453 Editor: Merge two strings.
Props pavelevap.
See #27756.
Built from https://develop.svn.wordpress.org/trunk@37441


git-svn-id: http://core.svn.wordpress.org/trunk@37407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-16 18:57: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
Andrea Fercia
1bb3dd0ee7 Accessibility: improvements for the Editor wpLink modal form fields.
Adds `aria-describedby` attributes to the modal form fields after it
was partly restored in [37154].

Fixes #33301.
Built from https://develop.svn.wordpress.org/trunk@37160


git-svn-id: http://core.svn.wordpress.org/trunk@37126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-05 22:24:27 +00:00
Andrew Ozz
2618ccf64d Editor, wpLink:
- Restore the bottom half of the modal.
- Make it always expanded and remove the toggle. It is used as advanced link options now, no need to have simple mode.

Props iseulde, adamsilverstein, azaozz.
Fixes #36359.
Built from https://develop.svn.wordpress.org/trunk@37154


git-svn-id: http://core.svn.wordpress.org/trunk@37120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-01 21:13:29 +00:00
Dominik Schilling
9a16bfb5dc Editor: Make the tooltip for the 'apply' button in the inline link dialog translatable.
Props SergeyBiryukov.
Fixes #36366.
Built from https://develop.svn.wordpress.org/trunk@37091


git-svn-id: http://core.svn.wordpress.org/trunk@37058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-29 21:11:28 +00:00
Andrew Ozz
571cf91329 TinyMCE, inline link:
- Remove bottom box-shadow from the Apply button so it matches the rest.
- Change the tooltip for the cogwheel button to Link options.

See #33301.
Built from https://develop.svn.wordpress.org/trunk@37001


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