Andrew Ozz
e03d853fe6
Fix typo/white space in the docs.
...
See #32425 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32900 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-21 22:07:48 +00:00
Andrew Ozz
e366658072
Update the TinyMCE initialization:
...
- Replace `wp_htmledit_pre()` and `wp_richedit_pre()` with `format_for_editor()`.
- Replace the `'htmledit_pre'` and `'richedit_pre'` filters with `'format_for_editor'`.
- Do not run the post content through `wpautop()` in PHP when the visual editor is default. Run the textarea content through the JS wpautop on initializing TinyMCE.
- Simplify both editors initialization.
- Improve setting of `wpActiveEditor` in Quicktags.
- Improve editor.js, use `tinymce.$` when possible.
See #32425 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32899 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-21 22:00:42 +00:00
Dominik Schilling (ocean90)
cf57a5e072
Use 3-digit x.x.x style for 4.3.0 @since versions.
...
see #32335 , #32430 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32897 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-21 11:40:05 +00:00
Andrew Ozz
af92620277
Update convert_chars():
...
- Stop trying to remove `<title>` and `<category>` meta tags. They have not been used for many many years.
- Replacement of `<br>` with `<br />` and `<hr>` with `<hr />` is not needed for HTML 5.0. Also, these tags are formatted like that by the visual editor.
- Replace invalid HTML entities that might be pasted in the Text editor on save instead of on display.
Fixes #32335 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32896 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-21 00:58:12 +00:00
Scott Taylor
ed8b9a8d27
wptexturize() improvements:
...
* Make sure that strings ending with a number and quotation mark get the proper smart quotes
* Introduce `wptexturize_primes()`, a logic tree to determine whether or not "7'." represents seven feet, then converts the special char into either a prime char or a closing quote char.
Adds unit tests.
Props miqrogroove.
Fixes #29256 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32863 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-19 20:05:52 +00:00
Andrew Ozz
5cb9a4b019
Fix using htmlspecialchars() whit the $double_encode parameter. PHP < 5.4 doesn't validate the entities.
...
Props miqrogroove. Fixes #17780 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32851 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-19 01:52:48 +00:00
Scott Taylor
4d8c4295f3
Since PHP 5.2.3, the htmlspecialchars() function has an optional $double_encode parameter, which we can now use. This will save us a few expensive kses/html decoding calls.
...
Adds unit tests.
Props miqrogroove.
Fixes #17780 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32850 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-18 21:59:10 +00:00
Scott Taylor
296c559baf
if is a statment, not a function.
...
See #32444 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32800 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 20:00:15 +00:00
Scott Taylor
a4765f9e1b
Document the default list of allowed protocols in the doc block for wp_allowed_protocols() and cross-reference in esc_url() and the kses_allowed_protocols filter.
...
Props GunGeekATX.
Fixes #32421 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32797 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 19:44:39 +00:00
Scott Taylor
86672e7d8c
sanitize_option() needs to handle WP_Error. DRY the conditional calls to add_settings_error().
...
Props chriscct7 for an initial patch.
Fixes #32350 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32791 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 01:28:47 +00:00
Scott Taylor
7abf3cb0c3
Add a note to wptexturize() docs.
...
Props miqrogroove.
Fixes #32521 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32790 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 00:56:35 +00:00
Scott Taylor
1e8fb99ebd
Improve the consistency of punctuation matching in wptexturize().
...
Adds unit tests.
Props miqrogroove.
Fixes #31886 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32789 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 00:49:45 +00:00
Scott Taylor
40bb9aa3d9
Allow 'Cockney' filter to be translated.
...
Updates unit test.
Props miqrogroove.
Fixes #31953 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32788 602fd350-edb4-49c9-b593-d223f7449a82
2015-06-16 00:45:49 +00:00
Scott Taylor
c8a44d437a
Add @static* annotations where they are missing.
...
Initialize all static vars that are not, most to `null`.
See #32444 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 15:42:40 +00:00
Scott Taylor
928dc46a3b
Add missing doc blocks to formatting.php.
...
Rehabilitate the spacing of various doc blocks.
Standardize some return values that are adjacent to similar functions.
See #32444 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32590 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-25 02:58:00 +00:00
Boone Gorges
5de66efda6
In sanitize_option(), pass the unsanitized $value to the filter.
...
Props simonwheatley, MikeHansenMe.
Fixes #26199 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32520 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-21 17:59:58 +00:00
Andrew Ozz
099c066e24
Check if running from /src or SCRIPT_DEBUG is defined in print_emoji_detection_script().
...
See #32118 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32482 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-10 18:23:21 +00:00
Sergey Biryukov
04ef03636e
Check if SCRIPT_DEBUG is defined before using it in print_emoji_detection_script().
...
props Craig Ralston.
fixes #32118 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@32296 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-26 10:35:53 +00:00
Gary Pendergast
96f12cc588
Clean up some edge cases in sanitize_sql_orderby().
...
Props vortfu, dd32.
git-svn-id: https://develop.svn.wordpress.org/trunk@32164 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-20 05:41:37 +00:00
Andrew Nacin
62b51d8c0b
Clean up wp_staticize_emoji() and friends.
...
* DOMDocument was removed in [31752] but not the check.
* wp_staticize_emoji() has never accepted a second arg; remove it from calls.
* Remove wp_staticize_emoji_for_feeds(), no need for it.
* Remove _ and @ignore from wp_staticize_emoji_for_email(), no need for it.
see #31242 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32161 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-20 04:14:32 +00:00
pento
cd9374f061
Emoji: The emoji JS files should be run through the script_loader_src filter, as they would be if they were registered scripts.
...
Props peterwilsoncc.
Fixes #31938 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32097 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-09 11:06:03 +00:00
Gary Pendergast
dcfb3532c1
Emoji: Tidy up the wp_encode_emoji() regex, and clarify the function comment on Unicode 8 support.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@32096 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-09 04:36:57 +00:00
Drew Jaynes
b04e2d5611
Various docs syntax fixes in wp-includes/formatting.php.
...
See #31888 .
git-svn-id: https://develop.svn.wordpress.org/trunk@32039 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-05 15:50:53 +00:00
Gary Pendergast
01cbacb308
Emoji: [31938] forgot a / in the emoji CDN URL.
...
See #31651 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31977 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-02 00:10:36 +00:00
Scott Taylor
bcf98c7742
Alter the regex in wptexturize() to properly handle input like: <> "Hello world" <>.
...
Updates unit test data.
Props miqrogroove.
Fixes #30344 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31965 602fd350-edb4-49c9-b593-d223f7449a82
2015-04-01 19:08:31 +00:00
Gary Pendergast
48e551feb5
Emoji: Change the emoji CDN to w.org, from wp.com.
...
See #31651 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31938 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-31 04:30:38 +00:00
Gary Pendergast
3945ee3f86
Emoji: When encoding emoji into HTML entities, 0 was being incorrectly trimmed from the right side of the hex string, causing some characters to be encoded incorrectly.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@31926 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-30 03:26:44 +00:00
Gary Pendergast
2fd1791bc1
Emoji: When staticizing emoji into <img> tags, include an alt attribute of the original Emoji, to match both Smiley and Twemoji <img> tags.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@31924 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-30 03:08:28 +00:00
Gary Pendergast
eced539d8b
Emoji: [31864] changed emoji image's inline style from height to max-height. Unfortunately, anything using feedparser.py (for example, NewsBlur) strips out max-height, which gives us massive emoji in feeds.
...
This re-adds `height`, and also reminds us why we can't have nice things.
See #31719 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31909 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-27 02:11:45 +00:00
Gary Pendergast
76eee7be6a
Emoji: Add a comment to print_emoji_detection_script() explaining how the include statement works as part of the grunt build process.
...
See #31701 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31881 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-25 04:08:07 +00:00
Gary Pendergast
5a0564bb8f
Emoji: Instead of loading the emoji JS files automatically, we now include a small JS shim in the header, to test if the user's browser needs Twemoji. It then loads the emoji JS files only if they're needed.
...
Props pento, azaozz.
Fixes #31701 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31875 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-24 23:32:23 +00:00
Gary Pendergast
b3e3766233
Emoji: Gmail doesn't obey an <img>'s inline CSS height rule, transforming it to min-height. To avoid giant smiley faces everywhere, we're changing the height rule to max-height, which Gmail plays nicer with.
...
Props janhenckens.
Fixes #31719 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31864 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-23 12:07:47 +00:00
Gary Pendergast
4d8a13fe33
Emoji: Set the emoji image protocol with set_url_scheme(), instead of defaulting to HTTPS.
...
Props extendwings.
Fixes #31735 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31861 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-23 02:10:35 +00:00
Gary Pendergast
48cb73bba1
Emoji: When we're replacing emoji with <img>s in email, we can only do that if the Content-Type is text/html - otherwise, they'll show up in the email as the HTML string.
...
Fixes #31720
git-svn-id: https://develop.svn.wordpress.org/trunk@31860 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-22 23:15:34 +00:00
Drew Jaynes
b939e06b06
Add more verbose inline documentation inside of wpautop() to more clearly explain what's going on.
...
Props ericlewis, johneckman, azaozz.
Fixes #31041 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31852 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-20 19:46:41 +00:00
Gary Pendergast
e3b2637699
When converting emoji in email to static images, check that the message is defined, otherwise we could cause PHP warnings.
...
Props nerrad.
Fixes #31708 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31847 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-20 12:31:30 +00:00
Gary Pendergast
2b3cfead22
Emoji: Rename the email and feed filter functions to be _ prefixed, and @ignore-d in the PHPDocs.
...
See #31242
git-svn-id: https://develop.svn.wordpress.org/trunk@31791 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-16 10:45:29 +00:00
Sergey Biryukov
47c69c3207
Fix typo in a comment in [31752].
...
see #31242 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31790 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-16 01:55:53 +00:00
Drew Jaynes
7bbdceb336
Clean up some inline documentation for emoji functionality, including a missing @since for mail_emoji(), and a changelog entry for wp_insert_post().
...
See #31242 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31789 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-16 01:42:26 +00:00
Andrew Ozz
005ff9a8c8
Emoji:
...
- Add the styling for the replacement images to the admin CSS.
- Revert to using `.emoji` as replacement image class.
- When pasting in the editor, convert emoji images to our format so we can replace them with chars on saving.
- Some more clean up of both the plugin and wp-emoji.js.
See #31242 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31786 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-15 23:15:28 +00:00
Gary Pendergast
3503aa4820
Smilies: The new smilies added in [31733] and [31745] are larger than the old smilies. While this is taken care of by the CSS on normal pages, it means they're disproportionally large when seen in RSS and email.
...
By adding a little bit of inline style to them, we get pleasingly sized smilies everywhere. :-)
See #31242
git-svn-id: https://develop.svn.wordpress.org/trunk@31781 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-15 11:40:16 +00:00
Sergey Biryukov
870da19630
Emoji and smiley images should be displayed inline.
...
see #31242 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31771 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-13 18:44:40 +00:00
Gary Pendergast
fa3131ee02
Emoji: There's a little tear in my eye as I remove DOMDocument from the Emoji staticizer. It was a beautiful dream, but it wasn't to be.
...
Instead, let's use the tried and trusted smiley replacement algorithm, which has stood the test of time.
See #31242
git-svn-id: https://develop.svn.wordpress.org/trunk@31752 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-12 13:16:34 +00:00
Gary Pendergast
1357e7fc2e
Add emoji URL support, and Twemoji fallback for displaying slugs in wp-admin, when the browser doesn't natively support emoji.
...
Props pento, SergeyBiryukov and boonebgorges.
Fixes #31328
git-svn-id: https://develop.svn.wordpress.org/trunk@31734 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-11 22:54:49 +00:00
Gary Pendergast
ae391ec226
Add emoji support, with Twemoji fallback.
...
Replace exisiting smilies with equivalent emoji, or with shiny new smiley images where no emoji existed.
Props batmoo, joen and mkaz for the original plugin upon which this is based.
Props pento, iseulde, kraftbj and peterwilsoncc for making the internet's dreams come true.
See #31242
git-svn-id: https://develop.svn.wordpress.org/trunk@31733 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-11 22:48:16 +00:00
Scott Taylor
edf982fcd5
Avoid function calls on each iteration of a for loop.
...
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31678 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-08 23:00:21 +00:00
Scott Taylor
79706ee8a8
Don't call the size function count() as part of a test condition in loops. Compute the size beforehand, and not on each iteration.
...
Scrutinizer added a Performance label: these are the only violations.
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31554 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-26 05:47:53 +00:00
Gary Pendergast
3a87ef36e2
Texturize: Add "em" as a cockney term, so that "'em" is texturized with an apostrophe, instead of an open quote.
...
Fixes #29813 .
Props miqrogroove.
git-svn-id: https://develop.svn.wordpress.org/trunk@31249 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-20 18:43:30 +00:00
Gary Pendergast
c8c8b66bae
When a hyphen - or double hyphen -- was at the start or the end of a string, it wasn't texturized correctly.
...
Fixes #31030
git-svn-id: https://develop.svn.wordpress.org/trunk@31199 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 03:54:00 +00:00
Scott Taylor
0c71d0033a
Ensure that <figcaption> is not autop'd.
...
Fixes #29219 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31186 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 00:26:36 +00:00