Commit Graph

343 Commits

Author SHA1 Message Date
Sergey Biryukov
5d87e7d2b8 Introduce wp_maybe_decline_date() for languages where certain date formats need to be declined, and hook it to the date_i18n filter.
If the locale specifies that month names require a genitive case in certain formats like `'j F Y'` or `'j. F'`, the month name will be replaced with a correct form. 

Fixes #11226.
Built from https://develop.svn.wordpress.org/trunk@35517


git-svn-id: http://core.svn.wordpress.org/trunk@35481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-04 21:28:26 +00:00
Gary Pendergast
21393df10e Embeds: Add fallbacks for IE7-9.
Older IE versions need just that little bit of extra tender care to keep them going.

Props peterwilsoncc, swissspidy, pento.

Fixes #34204.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-31 04:38:25 +00:00
Drew Jaynes
e6d50be991 Multisite: Restore display of the Toolbar on wp-activate.php while logged-in.
Just as with wp-signup.php, display of the Toolbar on wp-activate.php was broken in [23512] due to a hook change for the `_wp_admin_bar_init()` callback. wp-signup.php was fixed in [35423] for #34418.

See [35423] for more in-depth background and reasoning behind restoring display of the Toolbar on wp-activate.php and wp-signup.php.

Fixes #34496. See #34418.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-30 04:24:23 +00:00
Gary Pendergast
368e5f9fc3 Embeds: Provide a cached text fallback.
Sometimes, embedded sites might suffer from less than 100% uptime. Instead of leaving the embedding site with a big blank space where the embed should be, let's fall back to a link to the embedded post, so there's at least some context for the post.

Fixes #34462.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-29 23:11:24 +00:00
Gary Pendergast
8be4a22f82 Embeds: Who put this REST API infrastructure in my WordPress?
Well, while it's here, we probably should make use of it. The oEmbed endpoint now uses the REST API infrastructure, instead of providing its own.

Props swissspidy.

Fixes #34207.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-29 22:51:24 +00:00
Drew Jaynes
33d9b8e4d0 Multisite: Restore displaying the Toolbar on wp-signup.php while logged-in.
Prior to [23512], the Toolbar was still displayed on wp-signup.php while logged-in because it was hooked to the `init` action. When `_wp_admin_bar_init()` was moved to instead fire on `template_redirect` for the front-end and `admin_init` on the back-end, the visibility was lost because `template_redirect` isn't fired on wp-signup.php due to `WP_USE_THEMES` not being defined.

In order to maintain expected display results, a default filter has been added to hook `_wp_admin_bar_init()` to the `before_signup_header` action. This approach has the added benefit of allowing `_wp_admin_bar_init()` to be fired prior to the `wp_head` action where `_admin_bar_bump_cb()` is called (or the callback defined when 'admin-bar' theme support is added).

Fixes #34418.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-28 20:30:25 +00:00
Gary Pendergast
1ebff5d223 Embeds: Move the embed iframe script to the footer, as it isn't being run until DOMContentLoaded is fired.
Props brainstormforce, pratikchaskar.

Fixes #344444.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-26 05:50:25 +00:00
Boone Gorges
3eab09a694 Don't force comment pagination.
[34561] instituted the policy of forcing pagination for comments. This strategy
was intended to avert problems when 'page_comments' is set to 0 - as it is by
default - and the number of comments on a given post rises into the hundreds or
thousands. By forcing pagination in all cases, we ensured that WordPress would
not time out by processing unwieldy numbers of comments on a given pageload.

The strategy proves problematic, however, because comment permalinks are
generated using the page of the comment. Forcing pagination for posts that
were not previously paginated would change the URL of all comments that do not
appear on the default comment page.

This changeset reintroduces the 'page_comments' setting and its corresponding
checkbox on Settings > Discussion. A number of tests, which were written after
[34561], are modified to work now that 'page_comments' will, once again, be
disabled by default.

See #8071.
Built from https://develop.svn.wordpress.org/trunk@35331


git-svn-id: http://core.svn.wordpress.org/trunk@35297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-21 16:26:42 +00:00
Sergey Biryukov
d76d340036 Embeds: After [35235], replace some missed oembed references with embed.
Props peterwilsoncc.
Fixes #34272.
Built from https://develop.svn.wordpress.org/trunk@35253


git-svn-id: http://core.svn.wordpress.org/trunk@35219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-17 23:26:47 +00:00
Sergey Biryukov
a908d2d4b1 Embeds: Rename files, functions, and hooks added in [34903] to make it more clear what is oEmbed-specific and what isn't.
See https://core.trac.wordpress.org/ticket/34272#comment:7 for full list of renamed functions and hooks.

Props swissspidy.
Fixes #34272.
Built from https://develop.svn.wordpress.org/trunk@35235


git-svn-id: http://core.svn.wordpress.org/trunk@35201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-17 01:21:25 +00:00
Scott Taylor
2e6865a7fb Widgets: add a default filter for widget_text (used by the Text widget), balanceTags, which respects the option for use_balanceTags.
Props MikeHansenMe.
Fixes #23083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:40:26 +00:00
Drew Jaynes
77314454a5 Embeds: If we're adding a boatload of new items to default-filters.php, might as well make them readable.
See #32522.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 22:31:24 +00:00
Ryan McCue
94e2352956 REST API: Introduce baby API to the world.
Baby API was born at 2.8KLOC on October 8th at 2:30 UTC. API has lots
of growing to do, so wish it the best of luck.

Thanks to everyone who helped along the way:

Props rmccue, rachelbaker, danielbachhuber, joehoyle, drewapicture,
adamsilverstein, netweb, tlovett1, shelob9, kadamwhite, pento,
westonruter, nikv, tobych, redsweater, alecuf, pollyplummer, hurtige,
bpetty, oso96_2000, ericlewis, wonderboymusic, joshkadis, mordauk,
jdgrimes, johnbillion, jeremyfelt, thiago-negri, jdolan, pkevan,
iseulde, thenbrent, maxcutler, kwight, markoheijnen, phh, natewr,
jjeaton, shprink, mattheu, quasel, jmusal, codebykat, hubdotcom,
tapsboy, QWp6t, pushred, jaredcobb, justinsainton, japh, matrixik,
jorbin, frozzare, codfish, michael-arestad, kellbot, ironpaperweight,
simonlampen, alisspers, eliorivero, davidbhayes, JohnDittmar, dimadin,
traversal, cmmarslender, Toddses, kokarn, welcher, and ericpedia.

Fixes #33982.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 02:31:25 +00:00
Gary Pendergast
83c3e3e00e Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 10:36:25 +00:00
Scott Taylor
99be7beda0 Merge the Responsive Images feature plugin into core, initial commit. See: https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images/
New functions in `media.php`:
* `wp_get_attachment_image_srcset_array()` - Returns an array of image candidate string data used to build a `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_srcset()` - Returns the `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_sizes()` - Returns the `sizes` value for an attachment given an `$attachement_id` and `$size` and optional arguments used to alter its output.
* `wp_make_content_images_responsive()` - A display filter for adding `srcset` and `sizes` to images embedded in content.
* `wp_img_add_srcset_and_sizes()` - A utility function used by `wp_make_content_images_responsive()` to add `srcset` and `sizes` to a single `<img>` element.

Modifies existing core functions:
* Modify `wp_get_attachment_image()` so the HTML returned for an image includes `srcset` and `sizes`.
* Modify `get_media_embedded_in_content()` (sup, 3.6 leftover) by adding `<img>` to the list of accepted tags that can be matched in content. This is used in `wp_make_content_images_responsive()` to find all of the images embedded in content before passing them off to `wp_img_add_srcset_and_sizes()`.

Tests:
* Add a new factory method to `WP_UnitTest_Factory_For_Attachment` named `create_upload_object()`
* Adds unit tests
* Updates unit tests

Props joemcgill, tevko, jaspermdegroot, mdmcginn, barryceelen, peterwilsoncc, fsylum, wonderboymusic, chriscoyier, benjaminpick, jrfnl, #12kingkool68, janhenckens, ryanmarkel, side777, ryelle, wturrell, micahmills, mattbagwell, coliff, DrewAPicture.
See #33641.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-06 04:59:24 +00:00
Boone Gorges
654eeb3785 Improve lazyloading of comment meta in WP_Query loops.
Lazy-loading logic is moved to a method on `WP_Query`. This makes it possible
for comment feeds to take advantage of metadata lazyloading, in addition to
comments loaded via `comments_template()`.

This new technique parallels the termmeta lazyloading technique introduced in
[34704].

Fixes #34047.
Built from https://develop.svn.wordpress.org/trunk@34711


git-svn-id: http://core.svn.wordpress.org/trunk@34675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 01:35:26 +00:00
Boone Gorges
db880777f4 Improve lazyloading of term metadata in WP_Query loops.
[34529] introduced lazyloading for the metadata belonging to terms matching
posts in the main `WP_Query`. The current changeset improves this technique
in the following ways:

* Term meta lazyloading is now performed on the results of all `WP_Query` queries, not just the main query.
* Fewer global variable touches and greater encapsulation.
* The logic for looping through posts to identify terms is now only performed once per `WP_Query`.

Props dlh, boonebgorges.
See #34047.
Built from https://develop.svn.wordpress.org/trunk@34704


git-svn-id: http://core.svn.wordpress.org/trunk@34668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 22:00:24 +00:00
Gary Pendergast
1db89dd3bf Rewrite: Redirect attachment URLs when their slug changes.
Using the same logic that we use to redirect posts when their slug changes, we can provide the same functionality for attachments. Attachment pages are posts, too.

Props swissspdy.

Fixes #34043.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 04:58:25 +00:00
Boone Gorges
18d6b3c8dc Force comment pagination on single posts.
Previously, the 'page_comments' toggle allowed users to disable comment
pagination. This toggle was only superficial, however. Even with
'page_comments' turned on, `comments_template()` loaded all of a post's
comments into memory, and passed them to `wp_list_comments()` and
`Walker_Comment`, the latter of which produced markup for only the
current page of comments. In other words, it was possible to enable
'page_comments', thereby showing only a subset of a post's comments on a given
page, but all comments continued to be loaded in the background. This technique
scaled poorly. Posts with hundreds or thousands of comments would load slowly,
or not at all, even when the 'comments_per_page' setting was set to a
reasonable number.

Recent changesets have addressed this problem through more efficient tree-
walking, better descendant caching, and more selective queries for top-level
post comments. The current changeset completes the project by addressing the
root issue: that loading a post causes all of its comments to be loaded too.

Here's the breakdown:

* Comment pagination is now forced. Setting 'page_comments' to false leads to evil things when you have many comments. If you want to avoid pagination, set 'comments_per_page' to something high.
* The 'page_comments' setting has been expunged from options-discussion.php, and from places in the codebase where it was referenced. For plugins relying on 'page_comments', we now force the value to `true` with a `pre_option` filter.
* `comments_template()` now queries for an appropriately small number of comments. Usually, this means the `comments_per_page` value.
* To preserve the current (odd) behavior for comment pagination links, some unholy hacks have been inserted into `comments_template()`. The ugliness is insulated in this function for backward compatibility and to minimize collateral damage. A side-effect is that, for certain settings of 'default_comments_page', up to 2x the value of `comments_per_page` might be fetched at a time.
* In support of these changes, a `$format` parameter has been added to `WP_Comment::get_children()`. This param allows you to request a flattened array of comment children, suitable for feeding into `Walker_Comment`.
* `WP_Query` loops are now informed about total available comment counts and comment pages by the `WP_Comment_Query` (`found_comments`, `max_num_pages`), instead of by `Walker_Comment`.

Aside from radical performance improvements in the case of a post with many
comments, this changeset fixes a bug that caused the first page of comments to
be partial (`found_comments` % `comments_per_page`), rather than the last, as
you'd expect.

Props boonebgorges, wonderboymusic.
Fixes #8071.
Built from https://develop.svn.wordpress.org/trunk@34561


git-svn-id: http://core.svn.wordpress.org/trunk@34525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 20:40:25 +00:00
Boone Gorges
8b4a5d1ec0 Introduce metadata for taxonomy terms.
Adds a new table to the database schema (`wp_termmeta`), and a set of
`*_term_meta()` API functions. `get_terms()` and `wp_get_object_terms()`
now also support 'meta_query' parameters, with syntax identical to other
uses of `WP_Meta_Query`.

When fetching terms via `get_terms()` or `wp_get_object_terms()`, metadata for
matched terms is preloaded into the cache by default. Disable this behavior
by setting the new `$update_term_meta_cache` paramater to `false`.

To maximize performance, within `WP_Query` loops, the termmeta cache is *not*
primed by default. Instead, we use a lazy-loading technique: metadata for all
terms belonging to posts in the loop is loaded into the cache the first time
that `get_term_meta()` is called within the loop.

Props boonebgorges, sirzooro.
See #10142.
Built from https://develop.svn.wordpress.org/trunk@34529


git-svn-id: http://core.svn.wordpress.org/trunk@34493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 03:59:27 +00:00
Boone Gorges
32887d3dfb Lazy-load comment meta on single post pages.
[34268] introduced cache priming for commentmeta, enabled by default. To
ensure performance on single post pages - where commentmeta is most likely
to cause performance issues - we disable up-front cache-priming. Instead, we
prime commentmeta caches for all comments in the loop the first time
`get_comment_meta()` is called on the page.

Props bradt, dd32, wonderboymusic, boonebgorges.
Fixes #16894.
Built from https://develop.svn.wordpress.org/trunk@34270


git-svn-id: http://core.svn.wordpress.org/trunk@34234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 20:01:24 +00:00
Boone Gorges
48b7547a52 Improve consistency of comment notification callback signatures.
Both `wp_new_comment_notify_moderator()` and `wp_new_comment_notify_postauthor()`
now accept a single argument: `$comment_ID`.

Props SergeyBiryukov.
Fixes #33587.
Built from https://develop.svn.wordpress.org/trunk@34252


git-svn-id: http://core.svn.wordpress.org/trunk@34216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 22:26:24 +00:00
Boone Gorges
85c00bd943 Move new user notification emails to add_action() callbacks.
When a new user is created in various places throughout the interface,
notifications are sent to the site admin and the new user. Previously, these
notifications were fired through direct calls to `wp_new_user_notification()`,
making it difficult to stop or modify the messages.

This changeset introduces a number of new action hooks in place of direct calls
to `wp_new_user_notification()`, and hooks the new wrapper function
`wp_send_new_user_notifications()` to these hooks.

Props dshanske, thomaswm, boonebgorges.
Fixes #33587.
Built from https://develop.svn.wordpress.org/trunk@34251


git-svn-id: http://core.svn.wordpress.org/trunk@34215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 22:19:24 +00:00
John Blackbourn
a78e850e9c Add the site icon meta tags to wp-login.php.
See #33597
Props iworks

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


git-svn-id: http://core.svn.wordpress.org/trunk@34092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 18:02:24 +00:00
Boone Gorges
b62bcef1b1 Send password-change email notifications via hook.
`wp_password_change_notification()` is now called at the 'after_password_reset'
action, rather than being invoked directly from the `reset_password()` function.

In order to make it possible to call `wp_password_change_notification()` as a
`do_action()` callback, the function signature has to be changed so that the
`$user` parameter is expected to be a value rather than a reference. Since
PHP 5.0, objects are passed by reference, so `&$user` was unnecessary anyway.

Props dshanske, thomaswm.
See #33587.
Built from https://develop.svn.wordpress.org/trunk@34107


git-svn-id: http://core.svn.wordpress.org/trunk@34075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:45:25 +00:00
Boone Gorges
c614849786 Send comment notification emails via a hooked function.
Previously, `wp_notify_postauthor()` and `wp_notify_moderator()` were called
directly from `wp_new_comment()`, making it difficult to modify or suppress
default notification emails.

Props dshanske, thomaswm.
See #33587.
Built from https://develop.svn.wordpress.org/trunk@34106


git-svn-id: http://core.svn.wordpress.org/trunk@34074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:17:26 +00:00
Boone Gorges
151d27369d Term splitting routine should be run in a separate process, triggered via wp-cron.
[32814] introduced a routine to split shared terms, which was run during the
regular WP database upgrade. This turned out to be problematic because plugins
are not loaded during the db upgrade (due to `WP_INSTALLING`), with the result
that plugins were not able to hook into the 'split_shared_term' action during
the bulk split. We work around this limitation by moving the term splitting
routine to a separate process, triggered by a wp-cron hook.

Props boonebgorges, Chouby, peterwilsoncc, pento, dd32.
Fixes #30261.
Built from https://develop.svn.wordpress.org/trunk@33615


git-svn-id: http://core.svn.wordpress.org/trunk@33582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-14 03:59:26 +00:00
Boone Gorges
2c9e81349c When splitting a shared 'nav_menu' term, ensure that nav items and theme locations are retained.
Props boonebgorges, dd32.
Fixes #33187.
Built from https://develop.svn.wordpress.org/trunk@33611


git-svn-id: http://core.svn.wordpress.org/trunk@33578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-12 14:07:26 +00:00
Mark Jaquith
309516a6c1 Move media hooks out of admin-filters.php as sometimes editors are used on the front end.
fixes #33257
props wonderboymusic
Built from https://develop.svn.wordpress.org/trunk@33590


git-svn-id: http://core.svn.wordpress.org/trunk@33557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-06 20:40:26 +00:00
Dominik Schilling
8679a93f16 Themes: Remove legacy theme preview.
The pre-3.4 theme previewer doesn't work when using a static front page.
We kept the old theme preview for no-JS and some browsers that were less capable. But since browsers are doing a better job today we don't need to continue fixing/shipping this legacy code. Bye!

fixes #33178.
Built from https://develop.svn.wordpress.org/trunk@33492


git-svn-id: http://core.svn.wordpress.org/trunk@33459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-29 18:36:26 +00:00
Andrew Ozz
4bd5e2db01 TinyMCE:
- Go back to encoding the editor content only when TinyMCE is used.
- Add check and encode `</textarea>` if present.
See #32425.
Built from https://develop.svn.wordpress.org/trunk@33187


git-svn-id: http://core.svn.wordpress.org/trunk@33159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 03:19:24 +00:00
Mark Jaquith
cf38b016e8 Revert [33038] because of objections raised on #22889 and #31590
Built from https://develop.svn.wordpress.org/trunk@33042


git-svn-id: http://core.svn.wordpress.org/trunk@33013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-02 00:47:24 +00:00
Mark Jaquith
9d11efe23c Say goodbye to ?replytocom=123 links and their URL pollution.
* Comment reply links continue to use JS as before.
* ?replytocom=123 links are deprecated.

props joostdevalk
fixes #22889
Built from https://develop.svn.wordpress.org/trunk@33038


git-svn-id: http://core.svn.wordpress.org/trunk@33009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-01 21:42:25 +00:00
Konstantin Obenland
c56a8ae0f7 Introducing Site Icon, favicon management for WordPress.
This v1 marries Jetpack's Site Icon module with the Media Modal, reusing code
from the Custom Header admin. For now, the core-provided icons will be limited
to a favicon, an iOS app icon, and a Windows tile icon, leaving `.ico` support
and additional icons to plugins to add.

Props obenland, tyxla, flixos90, jancbeck, markjaquith, scruffian.
See #16434.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-29 12:58:25 +00:00
Andrew Ozz
e4758f42e5 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.
Built from https://develop.svn.wordpress.org/trunk@32899


git-svn-id: http://core.svn.wordpress.org/trunk@32870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-21 22:01:28 +00:00
Andrew Ozz
b9a4fefb08 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.
Built from https://develop.svn.wordpress.org/trunk@32896


git-svn-id: http://core.svn.wordpress.org/trunk@32867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-21 00:59:26 +00:00
Andrew Ozz
82fcdec660 Editor: do not reuse the preview tab when the user has navigated away.
See #32588.
Built from https://develop.svn.wordpress.org/trunk@32809


git-svn-id: http://core.svn.wordpress.org/trunk@32780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 23:13:26 +00:00
Andrew Nacin
6df83c542b Revert change to default-filters.php in [32632]. see #32516.
Built from https://develop.svn.wordpress.org/trunk@32633


git-svn-id: http://core.svn.wordpress.org/trunk@32603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 05:52:25 +00:00
Andrew Nacin
65c382d550 Fix return error in get_theme_mods() from [32629].
Split a line with both an assignment and a conditional, not to mention an interpolated variable. Lots going on, easy mistake to make.

props BrianLayman.
fixes #32516.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 05:51:25 +00:00
Drew Jaynes
4c37f68b79 Fix inline documentation syntax in wp_xmlrpc_server.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-25 06:25:25 +00:00
Andrew Nacin
7f1b31f80f 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-20 04:15:26 +00:00
Gary Pendergast
2c45fd7ed7 Emoji: Revert [31877], and print the emoji shim and styles during admin_print_scripts and admin_print_styles, instead. This is a few milliseconds slower, but easier to reuse in Press This, and any other code that uses admin scripts and styles, without using admin-header.php.
See #31701.


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


git-svn-id: http://core.svn.wordpress.org/trunk@31858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-25 01:43:28 +00:00
Gary Pendergast
b53b12ff8c 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@31854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-24 23:33:32 +00:00
Gary Pendergast
a97462e755 Emoji: Rename the email and feed filter functions to be _ prefixed, and @ignore-d in the PHPDocs.
See #31242


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


git-svn-id: http://core.svn.wordpress.org/trunk@31773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-16 10:46:26 +00:00
Andrew Ozz
a7fd4a3774 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.
Built from https://develop.svn.wordpress.org/trunk@31786


git-svn-id: http://core.svn.wordpress.org/trunk@31766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-15 23:16:29 +00:00
Gary Pendergast
46e2a65cf1 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


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


git-svn-id: http://core.svn.wordpress.org/trunk@31714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 22:49:28 +00:00
Helen Hou-Sandí
c16129d3cf Enable more flexibility for non-URL GUIDs.
props stevenkword.
fixes #31080.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 20:00:26 +00:00
Sergey Biryukov
bff59aa8cb Revert the part of [31168] that [31701] was trying to fix.
`default-filters.php` is loaded before the `$current_site` global is set, so `is_main_site()` cannot be used there.

fixes #30947.
Built from https://develop.svn.wordpress.org/trunk@31708


git-svn-id: http://core.svn.wordpress.org/trunk@31689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-10 23:20:26 +00:00
Sergey Biryukov
74dfb2680b Don't run update checks for AJAX requests after [31168].
fixes #30947.
Built from https://develop.svn.wordpress.org/trunk@31701


git-svn-id: http://core.svn.wordpress.org/trunk@31682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-10 19:30:27 +00:00
Andrew Ozz
848cd46e9a PressThis TinyMCE: set 'directionality' and add the LTR button when in RTL. Fixes #31474.
Built from https://develop.svn.wordpress.org/trunk@31580


git-svn-id: http://core.svn.wordpress.org/trunk@31561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-27 20:21:24 +00:00
Boone Gorges
44ac816aed Split shared taxonomy terms on term update.
When updating an existing taxonomy term that shares its `term_id` with
another term, we generate a new row in `wp_terms` and associate the updated
term_taxonomy_id with the new term. This separates the terms, such that
updating the name of one term does not change the name of any others.

In cases where a plugin or theme stores term IDs in the database, term splitting
can cause backward compatibility issues. The current changeset introduces
two utilities to aid developers with the transition. The `'split_shared_term'`
action fires when the split takes place, and should be used to catch changes in
term_id. In cases where `'split_shared_term'` cannot be used, the
`wp_get_split_term()` function gives developers access to data about terms
that have previously been split. Documentation for these functions, with
examples, can be found in the Plugin Developer Handbook. WordPress itself
stores term IDs in this way in two places; `_wp_check_split_default_terms()`
and `_wp_check_split_terms_in_menus()` are hooked to `'split_shared_term'` to
perform the necessary cleanup.

See [30241] for a previous attempt at the split. It was reverted in [30585]
for 4.1.0.

Props boonebgorges, mboynes.
See #5809.
Built from https://develop.svn.wordpress.org/trunk@31418


git-svn-id: http://core.svn.wordpress.org/trunk@31399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-11 19:42:25 +00:00
Scott Taylor
fc843ce4d0 There are some random add_action() and add_filter() calls littered around some files in wp-includes/. These should be moved to wp-includes/default-filters.php with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even SHORTINIT - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 16:40:23 +00:00
Boone Gorges
213ecc8a07 Revert shared taxonomy term splitting for 4.1.
This is a revert of [30494], [30492], [30347], and [30334]. The latter
changeset was a revert of [30336], which was a revert of [30241].

Watch for Term Splitting, Version III in version 4.2, coming soon to a
WordPress trunk near you.

See #30335, #5809.
Built from https://develop.svn.wordpress.org/trunk@30585


git-svn-id: http://core.svn.wordpress.org/trunk@30575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-27 00:05:22 +00:00
John Blackbourn
2aabde8f74 Remove whitespace accidentally introduced in r30498
See #30335

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


git-svn-id: http://core.svn.wordpress.org/trunk@30488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 04:01:22 +00:00
John Blackbourn
196e069c5b split_shared_term is an action, not a filter.
See #30335

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


git-svn-id: http://core.svn.wordpress.org/trunk@30487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 03:51:21 +00:00
Boone Gorges
57e358da63 Improve cleanup of cached term_ids after shared terms are split.
* If the split term ID is stored as 'default_category', 'default_link_category', or 'default_email_category', update it to the new ID.
* If the split term ID is associated with a nav menu item, update that piece of postmeta to the new ID.

Props mboynes.
See #30335.
Built from https://develop.svn.wordpress.org/trunk@30494


git-svn-id: http://core.svn.wordpress.org/trunk@30483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-21 03:17:22 +00:00
Scott Taylor
be08f576df Improve some post_status-related documentation.
Props ericlewis.
See #30230.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-01 20:20:23 +00:00
John Blackbourn
0f64edb657 Introduce a new means of outputting a <title> tag in the theme head. Requires a theme to add support by calling add_theme_support( 'title-tag' ). This is the first step in adding a more robust means of generating and outputting the title tag.
See #18548.
Props obenland, chrisbliss18, joostdevalk.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:12:22 +00:00
Scott Taylor
d2c99a5646 Add a default filter to title_save_pre: trim, because extra whitespace.
Props nikolov.tmw, avryl.
Fixes #19904.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-01 18:58:16 +00:00
Andrew Nacin
acba3131d7 Allow for custom authentication handlers for all requests.
Turn the logic used by wp_get_current_user() into a determine_current_user filter.

props rmccue.
fixes #26706.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-09 15:23:15 +00:00
Andrew Ozz
eba12cfaf4 Remove unused arg from wp_auth_check(), see #27081.
Built from https://develop.svn.wordpress.org/trunk@27154


git-svn-id: http://core.svn.wordpress.org/trunk@27021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-09 22:34:11 +00:00
Andrew Nacin
60cc98b86d Run wp_auth_check on every heartbeat tick.
wp_heartbeat_received only runs when data is sent. We want to always pass this data back, though.

fixes #27081.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-09 22:28:12 +00:00
Dion Hulse
7f1047ece1 Remove the experimental RSS.JS feed, and move it to a plugin for feature development. Unprops pento. See #25639
Built from https://develop.svn.wordpress.org/trunk@26644


git-svn-id: http://core.svn.wordpress.org/trunk@26534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 22:24:10 +00:00
Andrew Nacin
c8bbc31c39 Add an experimental rssjs feed based on the experimental rss.js spec.
This is simply a JSON representation of the RSS 2.0 feed, accessible at /feed/rssjs/ anywhere.

props pento.
see #25639.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-20 22:58:09 +00:00
Scott Taylor
eeb3b15936 Pass the taxonomy around to relevant nav menu actions to avoid arbitrarily deleting all items with menu-item-type of taxonomy. Adds unit test for wp_get_associated_nav_menu_items().
Props garyc40, SergeyBiryukov.
Fixes #15264.


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


git-svn-id: http://core.svn.wordpress.org/trunk@25142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-29 16:45:10 +00:00
Andrew Nacin
d26e92d60f Remove unnecessary loops in default-filters.php.
props Jayjdk.
fixes #25011.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-27 11:59:11 +00:00
Andrew Nacin
24a9673b1e Format WordPress in <title> tags produced by wp_title().
props evansolomon.
fixes #19211.


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


git-svn-id: http://core.svn.wordpress.org/trunk@25077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-22 21:59:10 +00:00
Andrew Nacin
1ec392175c Additional checks when evaluating the safety of an HTTP request, to avoid false negatives.
* Check if the host is considered a safe redirect host.
 * Check if the host is another domain in a multisite installation.
 * Add a filter to control this.

This only occurs when the DNS resolution of a domain points elsewhere in an internal network, but only internally (and has its own public IP outside the network). This could be considered a bad configuration.

fixes #24646.



git-svn-id: http://core.svn.wordpress.org/trunk@24915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-31 06:44:57 +00:00
Andrew Nacin
5c20d1eca1 Remove "special" multisite spam check in the authentication API.
The spamming of a site no longer directly affects a user of said site.

Moves the spam check to the wp_authenticate filter. Networks in need
of enhanced spam-fighting should leverage this same technique.

Allow is_user_spammy() to accept a WP_User object.

props willnorris, brianhogg.
fixes #24771. see #19714.



git-svn-id: http://core.svn.wordpress.org/trunk@24848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-29 03:23:51 +00:00
Ryan Boren
cbf77c6523 Fire wp_auth_check_load() from admin_enqueue_scripts instead of admin_init so that it can access the current screen object.
Black list the update and upgrade screens.

Allow plugins to white/black list screens via the wp_auth_check_load filter.

Props nacin

see #23295


git-svn-id: http://core.svn.wordpress.org/trunk@24738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-18 19:06:35 +00:00
Andrew Nacin
098ea1a759 Revert title auto-generation for asides and statuses.
Reverts [24043] and related.

fixes #24011.



git-svn-id: http://core.svn.wordpress.org/trunk@24693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-12 22:35:38 +00:00
Andrew Nacin
c48e009b05 Don't store a revision for the initial call to wp_insert_post(), only on saves.
In core UI (and XML-RPC), we first create an auto-draft via get_default_post_to_edit(), which means the first "save" is in practice the first revision.

This reverts [23842].

fixes #24708.



git-svn-id: http://core.svn.wordpress.org/trunk@24650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-10 22:40:42 +00:00
Ryan Boren
419fea1a16 Normalize the UTF-8 and ISO-8859-1 charset strings stored in blog_charset to make them friendlier with PHP functions that accept a charset such as htmlspecialchars().
fixes #23688


git-svn-id: http://core.svn.wordpress.org/trunk@24510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-25 19:03:17 +00:00
Mark Jaquith
c5530f9fc6 Revert [23450]. Removes post format compat.
see #23347, #24452. closes #24454.

git-svn-id: http://core.svn.wordpress.org/trunk@24387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-30 17:55:22 +00:00
Ryan Boren
a2b4bc456f * Introduce wp_parse_post_content() and use it in setup_postdata(), get_the_content(), and get_the_remaining_content().
* Add a post ID argument to the_content(), get_the_content(), the_remaining_content(), and get_the_remaining_content().
* Pass the post ID to the the_content filter.
* Remove the format_pages global.
* Declare format_content and split_content as vars in WP_Post.
* phpdoc for the the_content filter that documents the new ID argument and denotes it as not-so-portable.

Props gcorne, DrewAPicture, duck_, aaroncampbell
see #24330


git-svn-id: http://core.svn.wordpress.org/trunk@24301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-20 11:05:50 +00:00
Sergey Biryukov
4f2a58e3df Update _post_formats_fix_empty_title() description. Make it clear that 'wp_insert_post_data' is a filter, not an action. props DrewAPicture. fixes #24303.
git-svn-id: http://core.svn.wordpress.org/trunk@24233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-10 14:53:34 +00:00
Mark Jaquith
18aab9531a Hide the post title and auto-generate based on the post body, for the status and aside post formats.
props kovshenin. see #24011.

git-svn-id: http://core.svn.wordpress.org/trunk@24043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-22 04:00:25 +00:00
Andrew Ozz
bdc3e9bdb9 Logged out warnings: by default, load only in the admin. Plugins and themes can load on the front-end when needed, see #23295
git-svn-id: http://core.svn.wordpress.org/trunk@23881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-30 19:17:09 +00:00
Mark Jaquith
3575abd055 Use the wp_insert_post hook to save revisions, so we save revisions for
an initial wp_insert_post() run, not just updates.

see #16215

git-svn-id: http://core.svn.wordpress.org/trunk@23842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-28 23:45:19 +00:00
Mark Jaquith
cccb2939db Fix a longstanding "off by one" revision authorship bug.
* Fixes old revision data on the fly when you open a post for editing.
* Uses post_name of revisions to store a post version number (-v1), so we know what has been fixed.
* Latest version should also have a revision stored, whereas before it did not.

props adamsilverstein, mdawaffe. fixes #16215.

git-svn-id: http://core.svn.wordpress.org/trunk@23823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-27 20:21:38 +00:00
Andrew Ozz
04c5aefbea Logged out warnings: add fallback text dialog for:
- The login page has "X-Frame-Options: DENY" header.
- Cross-domain when displaying on the front-end on multisite with domain mapping.
- The site forces ssl login but not ssl admin.

Add onbeforeunload prompt to counter (frame-busting) JS redirects. Move the JS and CSS into separate files. See #23295.

git-svn-id: http://core.svn.wordpress.org/trunk@23805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-27 08:43:11 +00:00
Ryan Boren
43a7e695e9 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Andrew Ozz
0910d5755e Improved logged out warnings, first run, props mintindeed, see #23295
git-svn-id: http://core.svn.wordpress.org/trunk@23504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-28 08:57:17 +00:00
Helen Hou-Sandí
6d49a9cc8c Output fallbacks / theme compat for post format metadata.
* Currently handles link, quote, image, gallery, audio, and video formats.
* `add_theme_support()` for a given post format is now an indicator that the theme handles format-specific metadata.
* If no support for a given format is defined, fallback output will be generated and hooked onto the_content if a post has metadata for that format.
* Fallbacks attempt to be smart about not duplicating data already appearing in the post content itself. Gallery is particularly liberal, looking for any instance of the gallery shortcode in the content, not just an exact match to the gallery shortcode defined in the format-specific meta.
* Compat output defaults to being wrapped in a `div` with a class of `post-format-content`.

Theme authors: please test and evaluate, keeping in mind that the goal is to support user expectations of not losing format-specific data they've entered in the admin when viewing the front-end of their site.

props wonderboymusic, beaulebens, helen. see #23347.


git-svn-id: http://core.svn.wordpress.org/trunk@23450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-18 19:22:58 +00:00
Ryan Boren
cc5ed3a485 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Peter Westwood
716d48e0cd Revisions: Before saving a new post revision make sure that something has changed in the fields that we are revisioning.
Fixes: #7392 and #9843 props adamsilverstein.


git-svn-id: http://core.svn.wordpress.org/trunk@23414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 11:36:32 +00:00
Andrew Ozz
98bf511b56 Heartbeat API: first run, see #23216
git-svn-id: http://core.svn.wordpress.org/trunk@23355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-29 06:15:25 +00:00
Andrew Nacin
82e9c40482 Validate pingback source URIs. Less verbose errors.
git-svn-id: http://core.svn.wordpress.org/trunk@23329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-01-22 22:30:08 +00:00
Andrew Nacin
f944aba4e5 Fix option name. props ocean90, see #21719.
git-svn-id: http://core.svn.wordpress.org/trunk@22070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-27 19:19:18 +00:00
Andrew Nacin
51ad055a68 New design and content for the welcome panel. First pass.
props lessbloat, helenyhou, georgestephanis, sabreuse, ryelle.
see #21368.



git-svn-id: http://core.svn.wordpress.org/trunk@22018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-26 19:44:43 +00:00
Andrew Nacin
a6c93e2f65 Always attempt to embed URLs in content, removing the Auto-embeds (autoembed_urls) option.
Remove the UI for setting the default width and height for embeds. Width was confusing as it
was blank by default (inheriting the content width from the theme, or 500px). The height is
now calculated as 1.5x the content width, or 1000px, whichever is smaller.

The [embed] shortcode can still receive manual height and width attributes. This just removes
the global settings.

props wonderboymusic. see #21719.



git-svn-id: http://core.svn.wordpress.org/trunk@21998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-25 07:10:09 +00:00
Andrew Nacin
5a362d3ace Call clean_post_cache() in wp_insert_post() after the manual query to change GUID. Remove the second call to clean_post_cache() previously done on the save_post hook. see #11399.
git-svn-id: http://core.svn.wordpress.org/trunk@21943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-21 18:52:15 +00:00
Andrew Nacin
7109699941 If the DB upgrade hasn't yet been run, assume the Link Manager is disabled. Important for multisite installs. props ryan. see #21307.
git-svn-id: http://core.svn.wordpress.org/trunk@21537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-16 23:09:40 +00:00
ryan
7351bce967 Escape editable_slug as a textarea.
git-svn-id: http://core.svn.wordpress.org/trunk@21049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-10 17:58:57 +00:00
ryan
ea30b9f210 Fire the wp_cron action from init instead of sanitize_comment_cookies so that cron handlers can rely on a fully initialized env. Props SergeyBiryukov, norocketsurgeon. fixes #19818
git-svn-id: http://svn.automattic.com/wordpress/trunk@20652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-30 21:02:54 +00:00
ryan
27630a4286 Schedule auto-draft deletion from post-new.php instead of from admin.php. This provides better throttling for large multisite installs and reduces the risk of a delete avalanche.
fixes #19663


git-svn-id: http://svn.automattic.com/wordpress/trunk@20453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-12 18:49:48 +00:00
duck_
cc0115ad8a Pass post_type through sanitize_key() instead of sanitize_user(). Fixes #20202.
For consistency with the registration API and because it does less work.


git-svn-id: http://svn.automattic.com/wordpress/trunk@20234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-21 15:04:00 +00:00
ryan
e3b46b25d3 Lose EOF ?>. Clean up EOF newlines. fixes #12307
git-svn-id: http://svn.automattic.com/wordpress/trunk@19712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-08 17:01:11 +00:00
westi
c39397033a Make it possible for commenter cookies to be disabled if someone wants to by setting them on an action instead of always. Fixes #17976 props SergeyBiryukov and pishmishy .
git-svn-id: http://svn.automattic.com/wordpress/trunk@19622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-21 10:57:42 +00:00
westi
1ff56e0182 Revert [18592] because there are issues to solve with autop/shortcode parsing ordering before we add this. See #10457 and #19411
git-svn-id: http://svn.automattic.com/wordpress/trunk@19547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-03 09:35:38 +00:00
ryan
45ddf08e07 Introduce wp_no_robots(). Call it for pages that should never be indexed, regardless of blog privacy settings. Props nacin. fixes #19251
git-svn-id: http://svn.automattic.com/wordpress/trunk@19304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-15 20:44:48 +00:00
ryan
0370bda8bc Count only published posts when updating term counts. Fire term count updates on transition_post_status. Props joehoyle. see #17548
git-svn-id: http://svn.automattic.com/wordpress/trunk@18932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-10-10 20:52:44 +00:00
ryan
96b3575b72 Pass the query object to _close_comments_for_old_posts() so that is_singular is checked for the proper query. Props kawauso. fixes #18109
git-svn-id: http://svn.automattic.com/wordpress/trunk@18836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-30 15:35:50 +00:00
nacin
f4c5d43326 Revert [18783], as it breaks term relationship counts for attachment taxonomies. see #17548.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-29 05:29:20 +00:00
ryan
d187cf2559 Count only published posts when updating term counts. Fire term count updates on transition_post_status. Props joehoyle. fixes #17548
git-svn-id: http://svn.automattic.com/wordpress/trunk@18783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-26 22:24:46 +00:00
nacin
e5ca4fea40 Strip a number of special characters in sanitize_title_with_dashes on save. Includes quotes (curly, angle), dashes, marks, etc. props SergeyBiryukov. props ampt for the unit tests in [UT438]. see #10797.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-18 19:53:59 +00:00
nacin
a96e0dff91 Remove support for <link rel=start>, end, up, and index. These rel="" values have been dropped by the HTML Working Group. props Elpie, kawauso, fixes #18128.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-15 16:54:59 +00:00
azaozz
dc936c54c1 Rename the newly added action 'after_theme_change' to 'after_switch_theme' so it matches the 'switch_theme' action, props scribu, see #17979
git-svn-id: http://svn.automattic.com/wordpress/trunk@18656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-08 20:59:41 +00:00
azaozz
c00346820f Make check_theme_switched() run an action so this enhancement is available to plugins and themes too, see #17979
git-svn-id: http://svn.automattic.com/wordpress/trunk@18655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-08 20:07:15 +00:00
azaozz
4852c5887f Avoid losing widgets when switching themes - take one, props aaroncampbell, see #17979
git-svn-id: http://svn.automattic.com/wordpress/trunk@18630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-09-02 22:13:55 +00:00
dd32
ef278df299 Store Plugin/Theme uploads in the Media Library properly. Add Scheduled cleanup +2hrs to clean up any aborted installation attempts. See #18182
git-svn-id: http://svn.automattic.com/wordpress/trunk@18617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-28 08:42:07 +00:00
azaozz
07d81969bd Fix action 'wp_print_footer_scropts' (on the front-end), see #11520
git-svn-id: http://svn.automattic.com/wordpress/trunk@18610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-26 20:31:30 +00:00
westi
0c0e2c180f Whitespace and code layout tidyup.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-24 10:59:06 +00:00
westi
de05fd1569 Parse shortcodes in text widgets by default. Fixes #10457 props tmoorewp, sillybean, jamescollins.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-24 10:54:48 +00:00
azaozz
f634dd5af4 Editor API enhancement, first run (still needs some work), see #17144
git-svn-id: http://svn.automattic.com/wordpress/trunk@18498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-03 10:19:00 +00:00
azaozz
23f490bb02 Support for using wp_enqueue_script() and wp_enqueue_style() in the HTML body. All scripts and styles are added in the footer, fixes #9346
git-svn-id: http://svn.automattic.com/wordpress/trunk@18446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-07-21 16:32:01 +00:00
ryan
2cfb1592f0 Mark import attachments as private. Schedule job to delete old import attachments. Introduce attachment context.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-22 23:25:28 +00:00
ryan
81a5f821fb Sanitize guid on save and display. Sanitize mime type on save. Don't allow changing mime type via edit form handlers. Protect hidden meta.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-22 23:19:42 +00:00
ryan
d4abef7def s/login_form/login_init/. Props sorich87. fixes #17411
git-svn-id: http://svn.automattic.com/wordpress/trunk@17918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-13 18:33:20 +00:00
nacin
4277cdb196 Don't allow indexing of replytocom URLs. fixes #16893.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-12 03:59:16 +00:00
ryan
b58636e914 Send X-Frame-Options: SAMEORIGIN for admin and login pages. see #12293
git-svn-id: http://svn.automattic.com/wordpress/trunk@17826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-06 21:28:53 +00:00
azaozz
1ffb2468a5 HTML mode for Distraction Free Writing, props koopersmith, see #17136
git-svn-id: http://svn.automattic.com/wordpress/trunk@17785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-05-02 08:10:23 +00:00
azaozz
258a8f6844 Distraction Free Writing mode, see #17136
git-svn-id: http://svn.automattic.com/wordpress/trunk@17695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-25 01:01:34 +00:00
westi
9c0a5cd498 Don't do SSL discovery for every RSD request. APP endpoint already respects the SSLness of the site. Fixes #15960.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-17 07:48:34 +00:00
markjaquith
6e1fc710d9 Do not attach wp_enqueue_scripts to login_head. New login_enqueue_scripts hook. props nacin. fixes #16586 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-18 05:10:58 +00:00
nacin
20c5d823bc Use wp_kses_post instead of wp_kses_data for a better balance between security and flexibility. fixes #16489 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-08 20:17:09 +00:00
ryan
80f47f270b Run sanitize_key() on post_status, comment_status, and ping_status on the way into the DB. Props duck_. For trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@17404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-02-06 18:37:20 +00:00
nacin
ea7ca70470 Defense in depth for comment text.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-12-31 16:30:38 +00:00
westi
afc867fe64 Remove the ghetto code and use the script loader properly on the login page.
Ensure that we actually have convertEntities available on the login page.
Introduce a login_footer action.
Hook in the script loader to the login_header and login_footer actions.
See #5919, #15124.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-27 06:57:10 +00:00
nacin
0373c403aa Remove redundant filter. props coffee2code. fixes #14285.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-26 03:34:28 +00:00
markjaquith
f67cae286d Push capital P filter back behind the wpautop one to catch Wordpress after opening HTML tag
git-svn-id: http://svn.automattic.com/wordpress/trunk@15877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-20 22:44:15 +00:00
ryan
0a01e66745 Prevent post and term hierarchy loops. Props mdawaffe. fixes #14662
git-svn-id: http://svn.automattic.com/wordpress/trunk@15806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-14 15:09:04 +00:00
ryan
7119110439 Unset global variables when they are no longer needed.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-07 20:12:49 +00:00
ryan
051b9c2f3b Do not run kses on display filters for front page views. see #14758
git-svn-id: http://svn.automattic.com/wordpress/trunk@15559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-02 15:06:07 +00:00
markjaquith
57deb5ec03 More judicious Wordpress-to-WordPress correction, to avoid bungling reasonable URLs. fixes #13971
git-svn-id: http://svn.automattic.com/wordpress/trunk@15377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-07-08 19:35:29 +00:00
nacin
48bc4e220c Revert [15219], [15250], some of [15249] for 3.0, revisit in 3.0.1. see #13822.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-14 19:52:30 +00:00
nacin
40e4de4ba8 Treat trash/untrash of posts associated with media items the same as other stati changes. props koopersmith, see #13822.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-14 08:33:48 +00:00
wpmuguru
9eaf91db65 hide unpublished items on frontend nav menus, props filosofo, fixes #13822
git-svn-id: http://svn.automattic.com/wordpress/trunk@15219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-11 15:34:32 +00:00
nacin
332bac61a1 Cleanups.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-31 16:11:20 +00:00
nacin
c3cf7e4ee0 Forever eliminate 'Wordpress' from the planet (or at least the little bit we can influence). props matt.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-27 16:11:27 +00:00
nacin
35a9bc1670 Properly format menu item title attributes and descriptions. props ryan, fixes #12864.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-23 22:56:51 +00:00
dd32
378f68a0a0 Introduce a 'post_updated' action, Fires when a post is updated, Post ID, Current and Previous post objects are passed. Updatewp_check_for_changed_slugs() to use new hook. See #12473
git-svn-id: http://svn.automattic.com/wordpress/trunk@14814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-23 07:49:21 +00:00
nacin
d1a37c1f31 When posts/terms are deleted/trashed, update associated menu items. Deleted post = deleted menu item, trashed post = menu item becomes a draft. props filosofo, see #13174
git-svn-id: http://svn.automattic.com/wordpress/trunk@14295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-29 07:33:56 +00:00
nacin
8c9f71bb57 More nav menu fixes. props filosofo. see #13148. fixes #13155, fixes #13157, fixes #13138, see #13134.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-28 18:30:32 +00:00
dd32
0b4ebffe70 Handle future-scheduled custom post_type's. Props waltervos. Fixes #12842
git-svn-id: http://svn.automattic.com/wordpress/trunk@14056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-10 12:17:19 +00:00
ryan
a7f987c35a Trigger adjacent_posts_rel_link() from wp_head only for single post pages to avoid unnecessary queries. see #10867
git-svn-id: http://svn.automattic.com/wordpress/trunk@14019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-06 15:06:42 +00:00
ryan
e25a65b36a Trim trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@13733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-03-17 16:27:25 +00:00
ryan
d0ccd6b2ee Move wp_shortlink_header to template_redirect. Props miqrogroove. see #10640
git-svn-id: http://svn.automattic.com/wordpress/trunk@13652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-03-10 21:19:54 +00:00
ryan
fcbca58853 wp_get_shortlink() and pluggable shortlink generation. fixes #10640
git-svn-id: http://svn.automattic.com/wordpress/trunk@13635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-03-09 19:36:38 +00:00
dd32
b1621c63ae Move Admin Colour Scheme picker to a hook. Props Jick. s/register_admin_color_themes()/register_admin_color_schemes/g. See #11625, Fixes #6837
git-svn-id: http://svn.automattic.com/wordpress/trunk@13487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-02-28 06:34:31 +00:00