Commit Graph

288 Commits

Author SHA1 Message Date
Andrew Nacin 65bf560b9d Remove wp_parse_post_content(), get_paged_content(), paginate_content() from 3.6, and remove the new $id parameters for get_the_content() and the_content().
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
2013-07-09 05:22:50 +00:00
Mark Jaquith b275c9418f Keep the Nav Menu walker from blowing up the layout on empty-titled items.
fixes #23254. props cais, SergeyBiryukov.

git-svn-id: https://develop.svn.wordpress.org/trunk@24560 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 15:41:46 +00:00
Mark Jaquith 977c747f43 Hide the Revisions meta box content if no-JS, as JS is required to actually do anything with revisions.
fixes #24405. props DrewAPicture, MikeHansenMe.

git-svn-id: https://develop.svn.wordpress.org/trunk@24557 602fd350-edb4-49c9-b593-d223f7449a82
2013-07-05 15:04:24 +00:00
Sergey Biryukov fbc2a6ca6d PHPDoc fixes and additions. fixes #24616.
git-svn-id: https://develop.svn.wordpress.org/trunk@24490 602fd350-edb4-49c9-b593-d223f7449a82
2013-06-21 12:45:11 +00:00
Andrew Nacin 43dcd6d9f4 Validate post password hash.
git-svn-id: https://develop.svn.wordpress.org/trunk@24466 602fd350-edb4-49c9-b593-d223f7449a82
2013-06-21 03:00:26 +00:00
Sergey Biryukov 0abc45b90f Fix E_STRICT notices in walkers. props dvarga. see #24356.
git-svn-id: https://develop.svn.wordpress.org/trunk@24377 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-28 03:29:15 +00:00
Ryan Boren 5f472898e5 Use the global post rather than the global post ID. They don't always match, and the global post is more canonical.
see #24330


git-svn-id: https://develop.svn.wordpress.org/trunk@24336 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-23 18:16:24 +00:00
Ryan Boren 2662748593 * 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: https://develop.svn.wordpress.org/trunk@24301 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-20 11:05:50 +00:00
Sergey Biryukov bb2a27be5b Use ellipsis instead of three dots. props tjsingleton, jordie23, wojtek.szkutnik, DrewAPicture, SergeyBiryukov. see #8714.
git-svn-id: https://develop.svn.wordpress.org/trunk@24207 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-08 21:27:31 +00:00
Sergey Biryukov b26b0cc0de Avoid a PHP notice in get_page_template_slug() if the page does not exist. props tollmanz. fixes #24250.
git-svn-id: https://develop.svn.wordpress.org/trunk@24191 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-07 18:44:22 +00:00
Dominik Schilling (ocean90) 3e0f930659 Revisions: Mark deprecated arguments in `wp_list_post_revisions()`.
* Second argument is now a string, which controls the revision type
* Back compat for $args['type']
* Remove lines for the old form-table format, since it's now just a list 

props a.hoereth. fixes #24213.

git-svn-id: https://develop.svn.wordpress.org/trunk@24175 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-04 12:54:00 +00:00
Dominik Schilling (ocean90) 67d2cfeb89 Revisions UI: Add translation contexts and remove unneeded lines.
props nao. fixes #23917.

git-svn-id: https://develop.svn.wordpress.org/trunk@24157 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-02 10:12:19 +00:00
Dominik Schilling (ocean90) bd5099a40a Revisions: Remove the ID from the "restored by" line. props adamsilverstein. see #18733.
git-svn-id: https://develop.svn.wordpress.org/trunk@24156 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-02 09:35:35 +00:00
Sergey Biryukov b5bf848ad2 Don't translate a single placeholder. Remove unused variables. props settle, DrewAPicture. fixes #24229.
git-svn-id: https://develop.svn.wordpress.org/trunk@24150 602fd350-edb4-49c9-b593-d223f7449a82
2013-05-01 03:11:44 +00:00
Andrew Nacin 12e7328690 Variables passed by reference do not need to be set first.
props kovshenin.
see #24222.



git-svn-id: https://develop.svn.wordpress.org/trunk@24129 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-29 14:48:31 +00:00
Andrew Ozz 239ccffe14 Revisions: compare revisions by date in wp_ajax_revisions_data(), deprecate the $parent arg in wp_list_post_revisions() as now revisions always include a copy of the current post, props adamsilverstein, see #23901
git-svn-id: https://develop.svn.wordpress.org/trunk@23975 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-12 19:29:21 +00:00
Andrew Ozz 8a8d7369d7 Revisions: remove the new _wp_last_revision_matches_current_post(), can be replaced by a simple revisions version check. Fixes #23913
git-svn-id: https://develop.svn.wordpress.org/trunk@23885 602fd350-edb4-49c9-b593-d223f7449a82
2013-04-02 19:39:48 +00:00
Mark Jaquith f18cddb1e1 Make sure the first revision is seen as coming from emptiness, so it can be restored.
props adamsilverstein. fixes #23898.

git-svn-id: https://develop.svn.wordpress.org/trunk@23872 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 20:50:09 +00:00
Andrew Ozz 4525912f59 Post revisions:
- Always update the revision version when updating post authors.
- Check if revisions have been updated and return early.
- Update the revisions by direct query to avoid resetting post_modified.
- Fix a bug where we may be comparing with an autosave but need to compare with the latest revision.

Fixes #16215.

git-svn-id: https://develop.svn.wordpress.org/trunk@23849 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-29 05:28:44 +00:00
Andrew Ozz 0a02f89dec Fix wp_list_post_revisions() to include all autosaves when listing autosaves only and properly include or exclude the current post, see #23665, see #16215
git-svn-id: https://develop.svn.wordpress.org/trunk@23830 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-28 00:56:44 +00:00
Mark Jaquith d9ac303f83 Give themers tangible, user-friendly template functions to take full advantage of structured post formats.
* 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
2013-03-27 18:34:59 +00:00
Peter Westwood ae03f1a0b6 Revisions: UI Update.
* Refines the UI to make it clearer and easier to use
* Introduces weighted tickmarks
* Fixes comparison bugs.

See #23497 props adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@23769 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-21 15:54:11 +00:00
Ryan Boren 72c65a3145 Fix i18n for revision diff strings displaying human time.
Props johnbillion
fixes #23723


git-svn-id: https://develop.svn.wordpress.org/trunk@23743 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-18 17:58:30 +00:00
Andrew Ozz e4b6b84d8e Pass post format as a class to TinyMCE's body, props adamsilverstein, fixes #23198
git-svn-id: https://develop.svn.wordpress.org/trunk@23730 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-16 05:57:54 +00:00
Sergey Biryukov 16f38de702 Make wp_link_pages() filterable. Add 'separator' argument. Simplify the function logic. props obenland, brianlayman. fixes #13578.
git-svn-id: https://develop.svn.wordpress.org/trunk@23653 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-08 18:33:52 +00:00
Peter Westwood ae4522b5f1 Revisions: Updates to the new Revisions UI.
Various Updates including:
 * i18n fixes
 * Added tracking of what revision ID was restored
 * async fetching of diffs so that slider works sooner even with many revisions

See #23497 props adamsilverstein, ethitter


git-svn-id: https://develop.svn.wordpress.org/trunk@23639 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-07 15:32:26 +00:00
Ryan Boren 6d2a8d2ef0 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: https://develop.svn.wordpress.org/trunk@23594 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-03 21:11:40 +00:00
Ryan Boren c363aea627 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: https://develop.svn.wordpress.org/trunk@23554 602fd350-edb4-49c9-b593-d223f7449a82
2013-03-01 16:28:40 +00:00
Peter Westwood 554627a0d5 Revisions: First pass an implementing a new UI/UX for reviewing the revisions of posts. See #23497 props adamsilverstein for the initial patch.
This implements a new revisions ui using Backbone and preserves all the old methods of "integration" so the change should be transparent to plugins using revisi
ons with CPTs.

This is the first pass and so there are a number of things still to be resolved, more details in the ticket. Feedback welcomed.


git-svn-id: https://develop.svn.wordpress.org/trunk@23506 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-28 15:14:34 +00:00
Ryan Boren a6c8efadb9 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: https://develop.svn.wordpress.org/trunk@23416 602fd350-edb4-49c9-b593-d223f7449a82
2013-02-14 22:51:06 +00:00
Ryan Boren 6d8bce688f Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@22634 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-17 15:11:29 +00:00
Andrew Nacin 80c7908e62 Sanity checks in get_body_class() to ensure we are operating on the type of queried object that we expect. props wonderboymusic. fixes #17662.
git-svn-id: https://develop.svn.wordpress.org/trunk@22451 602fd350-edb4-49c9-b593-d223f7449a82
2012-11-07 22:12:44 +00:00
Ryan Boren 7ba5099795 Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865
git-svn-id: https://develop.svn.wordpress.org/trunk@22118 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-04 20:00:16 +00:00
Andrew Nacin 1d1c3e27ce Add no-customize-support to the body classes when the toolbar is showing. Allows for 'Customize' to be hidden when JS is disabled. props obenland, DrewAPicture. fixes #20896.
git-svn-id: https://develop.svn.wordpress.org/trunk@22107 602fd350-edb4-49c9-b593-d223f7449a82
2012-10-03 20:54:54 +00:00
Andrew Nacin 04b5a04297 Don't output the {$post_type} post class in the admin, to avoid clashes with admin CSS. props c3mdigital. fixes #21203.
git-svn-id: https://develop.svn.wordpress.org/trunk@21848 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-14 18:57:11 +00:00
Ryan Boren 504c616055 phpdoc fixes and additions for post-template.php. Props c3mdigital. fixes #21220
git-svn-id: https://develop.svn.wordpress.org/trunk@21799 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-10 20:04:33 +00:00
Ryan Boren 96c86ed800 Restore in get_the_excerpt(). Props c3mdigital. fixes #21797
git-svn-id: https://develop.svn.wordpress.org/trunk@21767 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-05 19:54:08 +00:00
Ryan Boren 31ec698423 Use get_post() instead of global $post.
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.

Props nacin
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21735 602fd350-edb4-49c9-b593-d223f7449a82
2012-09-04 16:29:28 +00:00
Ryan Boren de06b81360 Remove return ref from all calls to get_post()
Return WP_Post from get_default_post_to_edit()
Replace all calls to get_page() with get_post()
see #21309


git-svn-id: https://develop.svn.wordpress.org/trunk@21597 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-23 20:01:10 +00:00
Ryan Boren 30218d5ea5 Introduce WP_Post class. Clean up ancestors handling. Props scribu, toppa. fixes #10381 see #21309
git-svn-id: https://develop.svn.wordpress.org/trunk@21559 602fd350-edb4-49c9-b593-d223f7449a82
2012-08-20 19:47:52 +00:00
Ryan Boren 8ac43209f5 Fix some spelling errors. Props thee17. fixes #21191
git-svn-id: https://develop.svn.wordpress.org/trunk@21333 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-25 18:06:13 +00:00
Andrew Nacin e256a654ba Deprecate sticky_class() in favor of post_class(). props solarissmoke, fixes #16675.
git-svn-id: https://develop.svn.wordpress.org/trunk@21253 602fd350-edb4-49c9-b593-d223f7449a82
2012-07-09 21:10:59 +00:00
Mark Jaquith 8e48096fcf Do not store post_excerpt in a temporary variable when we can just return it directly. props niallkennedy. fixes #21041
git-svn-id: https://develop.svn.wordpress.org/trunk@21159 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-28 19:26:06 +00:00
Andrew Nacin 740d615ce2 Fix validation issue in get_the_password_form() caused by wpautop(). see #21018 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@21124 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-26 03:20:51 +00:00
Andrew Nacin 8c9bce5737 Do not specify background-image: none when a user removes a custom background
on a theme that has a default background image.

The onus is on the theme to omit the default background-image from style.css,
to allow the user to remove the default background image. Or, the theme can
specify a background-image for the body selector, as long as they then zero
it out for body.custom-background, like so:

{{{
body {
	background-image: url( ... );
}
body.custom-background {
	background-image: none;
}
}}}

This allows the theme to be compatible with the custom background feature
but also gracefully degrade if the background feature is disabled.

This is the same behavior as 3.3; setting a default image has simply been
made more prominent in 3.4. Reverts [21013], also parts of [21001].
see #20448 for change and discussion history.

see #20132, which will now be marked as invalid.

Also, per previous changes in #20448, the custom-background class should not
be shown when only a default color is in use.

fixes #20448.



git-svn-id: https://develop.svn.wordpress.org/trunk@21054 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-11 21:25:05 +00:00
Ryan Boren 2dbb51b71f Fix removing the default background image for themes that hard-code the default in css. Honor the default background image for themes that do not provide a fallback in css.
* <style> will appear if there is a default image registered. This is the same as 3.3.
* If only a default color is registered, it still assumes it is in the stylesheet, and no <style> will appear. This is a change from 3.3.
* <style> will continue to appear as before if there is a custom background color or image. This is the same as 3.3.
* This then allows for a default background image with background-image: none, overriding style.css. This is new.

Props nacin
see #20448


git-svn-id: https://develop.svn.wordpress.org/trunk@21001 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-05 18:35:31 +00:00
Ryan Boren b85e8d138c Custom background fixes:
* Specify default background colors for the bundled themes.
* Change the default custom background callback to only operate on saved values, rather than default values.
* Prevent an unsaved default value from overriding a manually modified style.css file.

Props nacin, kobenland
fixes #20448


git-svn-id: https://develop.svn.wordpress.org/trunk@20973 602fd350-edb4-49c9-b593-d223f7449a82
2012-06-01 20:31:50 +00:00
Ryan Boren ac3e71ac63 Don't escape anchor text as an attributein wp_get_attachment_link(). Props SergeyBiryukov. fixes #19282
git-svn-id: https://develop.svn.wordpress.org/trunk@20654 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-30 21:22:58 +00:00
Ryan Boren 577286e19d Always show search-results or search-no-results for searches, even archive searches. Props johnbillion. fixes #20435
git-svn-id: https://develop.svn.wordpress.org/trunk@20595 602fd350-edb4-49c9-b593-d223f7449a82
2012-04-25 20:38:40 +00:00
Andrew Nacin 11fd4b45c0 Introduce get_page_template_slug( $id = null ) to return a page's template (like "showcase.php"). Returns false if post ID is not a page, and an empty string for the default page template. Use the function across core. props billerickson for initial patch. fixes #18750.
git-svn-id: https://develop.svn.wordpress.org/trunk@20075 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-02 18:56:54 +00:00