The content parsing functions are good abstractions, but are no longer needed by core and are too closely tied to legacy globals, rather than paving a new path.
For get_the_content() and the_content(), this only worsens the function prototype. It muddies theme-specific display (more links, etc) with filtered content. `apply_filters( 'the_content', $post->post_content )` is sufficient practice for now.
see #24330, [24301]. see #23625, [23804].
git-svn-id: https://develop.svn.wordpress.org/trunk@24598 602fd350-edb4-49c9-b593-d223f7449a82
* 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: https://develop.svn.wordpress.org/trunk@24301 602fd350-edb4-49c9-b593-d223f7449a82
If there is only one post type used by all taxonomies for a tax query, set the post type to the string.
fixes#24204.
git-svn-id: https://develop.svn.wordpress.org/trunk@24115 602fd350-edb4-49c9-b593-d223f7449a82
* the_audio()
* the_video()
* the_image()
* get_the_media()
Also introduces:
* get_the_extra_content()
* the_extra_content()
Those two functions are like their non-extra versions, except that they
will have any post-format bits extracted. e.g. It's an image post, for
which the_image() will extract an <img /> tag. the_extra_content() will
output the content *without* that image.
props wonderboymusic. Herculean effort. fixes#23572
git-svn-id: https://develop.svn.wordpress.org/trunk@23819 602fd350-edb4-49c9-b593-d223f7449a82
* add_chat_detection_format() — to add a chat regex pattern
* get_content_chat() — to grab a chat from content
* get_the_chat() — grab the chat from the current (or passed) post
* the_chat() — output the chat in formatted HTML
* paginate_content() — puts the <!--nextpage--> splitting stuff into a function
* get_paged_content() — grabs a page of raw content, needed to paginate chats properly
see #23625. props wonderboymusic, lancewillett.
git-svn-id: https://develop.svn.wordpress.org/trunk@23804 602fd350-edb4-49c9-b593-d223f7449a82
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: https://develop.svn.wordpress.org/trunk@23416 602fd350-edb4-49c9-b593-d223f7449a82
* Set post_count and found_posts for all 'fields' queries.
* Set found_posts to post_count when limits are not used
* Update phpdoc for $found_posts and set_found_posts()
Props SergeyBiryukov, wonderboymusic
fixes#14426
git-svn-id: https://develop.svn.wordpress.org/trunk@21928 602fd350-edb4-49c9-b593-d223f7449a82
Prevents posts of a type no longer assigned to a queried taxonomy from being returned.
props jondavidjohn. fixes#21290.
git-svn-id: https://develop.svn.wordpress.org/trunk@21855 602fd350-edb4-49c9-b593-d223f7449a82