Commit Graph

294 Commits

Author SHA1 Message Date
Andrew Nacin
1ef62770d2 Remove display of 'Previously restored by' in the revisions meta box as it is busted.
Fixes invalid markup (missing closing ul tag) when there was no previously restored revision.

see #25051 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-31 01:33:09 +00:00
Sergey Biryukov
aadd546d48 Avoid PHP notices in get_sample_permalink() and get_sample_permalink_html(). Remove unused global reference. props ocean90. fixes #25005.
Built from https://develop.svn.wordpress.org/trunk@25028


git-svn-id: http://core.svn.wordpress.org/trunk@25015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-15 16:25:12 +00:00
Peter Westwood
11f6b487b9 Restore the for/id attributes in the post password for as they are necessary for accessibility tools. Fixes #18729.
Built from https://develop.svn.wordpress.org/trunk@25011


git-svn-id: http://core.svn.wordpress.org/trunk@25005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-07 13:44:32 +00:00
Peter Westwood
09ddd48b07 Make is much easier for a theme to style the Post Password form.
Fixes #18729 props philiparthurmoore for the original patches.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-07 13:43:50 +00:00
Mark Jaquith
e553e85ebb Remove $pagenow global from three functions that don’t use it.
Props jeremyfelt. Fixes #24920.

git-svn-id: http://core.svn.wordpress.org/trunk@24974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-02 04:42:08 +00:00
Mark Jaquith
60c9de28b4 Allow the_title_attribute() to receive a post argument, and use this in get_adjacent_post_rel_link() to make sure tags are stripped from the title output there.
Fixes #24232.

git-svn-id: http://core.svn.wordpress.org/trunk@24783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-23 16:05:40 +00:00
Andrew Nacin
092a33115c 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: http://core.svn.wordpress.org/trunk@24598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-09 05:22:50 +00:00
Mark Jaquith
92af914abe Keep the Nav Menu walker from blowing up the layout on empty-titled items.
fixes #23254. props cais, SergeyBiryukov.

git-svn-id: http://core.svn.wordpress.org/trunk@24560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-05 15:41:46 +00:00
Mark Jaquith
12ec3e4d69 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: http://core.svn.wordpress.org/trunk@24557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-07-05 15:04:24 +00:00
Sergey Biryukov
58c364947f PHPDoc fixes and additions. fixes #24616.
git-svn-id: http://core.svn.wordpress.org/trunk@24490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-21 12:45:11 +00:00
Andrew Nacin
95800ae4f2 Validate post password hash.
git-svn-id: http://core.svn.wordpress.org/trunk@24466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-06-21 03:00:26 +00:00
Sergey Biryukov
4b13a1ffa4 Fix E_STRICT notices in walkers. props dvarga. see #24356.
git-svn-id: http://core.svn.wordpress.org/trunk@24377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-28 03:29:15 +00:00
Ryan Boren
99dc867670 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: http://core.svn.wordpress.org/trunk@24336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-23 18:16:24 +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
57c10eadbb Use ellipsis instead of three dots. props tjsingleton, jordie23, wojtek.szkutnik, DrewAPicture, SergeyBiryukov. see #8714.
git-svn-id: http://core.svn.wordpress.org/trunk@24207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-08 21:27:31 +00:00
Sergey Biryukov
13adb37ce1 Avoid a PHP notice in get_page_template_slug() if the page does not exist. props tollmanz. fixes #24250.
git-svn-id: http://core.svn.wordpress.org/trunk@24191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-07 18:44:22 +00:00
Dominik Schilling
8ebc1c654e 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: http://core.svn.wordpress.org/trunk@24175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-04 12:54:00 +00:00
Dominik Schilling
ea1cecebee Revisions UI: Add translation contexts and remove unneeded lines.
props nao. fixes #23917.

git-svn-id: http://core.svn.wordpress.org/trunk@24157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-02 10:12:19 +00:00
Dominik Schilling
0de35b1035 Revisions: Remove the ID from the "restored by" line. props adamsilverstein. see #18733.
git-svn-id: http://core.svn.wordpress.org/trunk@24156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-02 09:35:35 +00:00
Sergey Biryukov
dd1ea44441 Don't translate a single placeholder. Remove unused variables. props settle, DrewAPicture. fixes #24229.
git-svn-id: http://core.svn.wordpress.org/trunk@24150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-01 03:11:44 +00:00
Andrew Nacin
3139a0451e Variables passed by reference do not need to be set first.
props kovshenin.
see #24222.



git-svn-id: http://core.svn.wordpress.org/trunk@24129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-29 14:48:31 +00:00
Andrew Ozz
44752d0dad 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: http://core.svn.wordpress.org/trunk@23975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-12 19:29:21 +00:00
Andrew Ozz
51826e4cde Revisions: remove the new _wp_last_revision_matches_current_post(), can be replaced by a simple revisions version check. Fixes #23913
git-svn-id: http://core.svn.wordpress.org/trunk@23885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-04-02 19:39:48 +00:00
Mark Jaquith
925e7f5bd6 Make sure the first revision is seen as coming from emptiness, so it can be restored.
props adamsilverstein. fixes #23898.

git-svn-id: http://core.svn.wordpress.org/trunk@23872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-29 20:50:09 +00:00
Andrew Ozz
7b831aabd3 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: http://core.svn.wordpress.org/trunk@23849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-29 05:28:44 +00:00
Andrew Ozz
fd602a987b 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: http://core.svn.wordpress.org/trunk@23830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-28 00:56:44 +00:00
Mark Jaquith
1b83157127 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: http://core.svn.wordpress.org/trunk@23819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-27 18:34:59 +00:00
Peter Westwood
9d6988a221 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: http://core.svn.wordpress.org/trunk@23769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-21 15:54:11 +00:00
Ryan Boren
dfd8479246 Fix i18n for revision diff strings displaying human time.
Props johnbillion
fixes #23723


git-svn-id: http://core.svn.wordpress.org/trunk@23743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-18 17:58:30 +00:00
Andrew Ozz
2c5ad0030f Pass post format as a class to TinyMCE's body, props adamsilverstein, fixes #23198
git-svn-id: http://core.svn.wordpress.org/trunk@23730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-16 05:57:54 +00:00
Sergey Biryukov
17a24f8400 Make wp_link_pages() filterable. Add 'separator' argument. Simplify the function logic. props obenland, brianlayman. fixes #13578.
git-svn-id: http://core.svn.wordpress.org/trunk@23653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-08 18:33:52 +00:00
Peter Westwood
51db623107 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: http://core.svn.wordpress.org/trunk@23639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-07 15:32:26 +00:00
Ryan Boren
315bfb019a Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-03 21:11:40 +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
Peter Westwood
9bd192fab3 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: http://core.svn.wordpress.org/trunk@23506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-28 15:14:34 +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
Ryan Boren
06ee370814 Pinking shears
git-svn-id: http://core.svn.wordpress.org/trunk@22634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-17 15:11:29 +00:00
Andrew Nacin
9beec00613 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: http://core.svn.wordpress.org/trunk@22451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-11-07 22:12:44 +00:00
Ryan Boren
77518e9c71 Objects no longer need to be explicitly passed by ref to call_user_func*() to be callable. Props wonderboymusic. fixes #21865
git-svn-id: http://core.svn.wordpress.org/trunk@22118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-04 20:00:16 +00:00
Andrew Nacin
830e30031a 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: http://core.svn.wordpress.org/trunk@22107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-10-03 20:54:54 +00:00
Andrew Nacin
7d7498f7ab Don't output the {$post_type} post class in the admin, to avoid clashes with admin CSS. props c3mdigital. fixes #21203.
git-svn-id: http://core.svn.wordpress.org/trunk@21848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-14 18:57:11 +00:00
Ryan Boren
249453b396 phpdoc fixes and additions for post-template.php. Props c3mdigital. fixes #21220
git-svn-id: http://core.svn.wordpress.org/trunk@21799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-10 20:04:33 +00:00
Ryan Boren
d61f2d464c Restore in get_the_excerpt(). Props c3mdigital. fixes #21797
git-svn-id: http://core.svn.wordpress.org/trunk@21767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-05 19:54:08 +00:00
Ryan Boren
cfb35a9d85 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: http://core.svn.wordpress.org/trunk@21735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-04 16:29:28 +00:00
Ryan Boren
f56d8278bb 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: http://core.svn.wordpress.org/trunk@21597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-23 20:01:10 +00:00
Ryan Boren
9377523bce Introduce WP_Post class. Clean up ancestors handling. Props scribu, toppa. fixes #10381 see #21309
git-svn-id: http://core.svn.wordpress.org/trunk@21559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-08-20 19:47:52 +00:00
ryan
fdae8f9b42 Fix some spelling errors. Props thee17. fixes #21191
git-svn-id: http://core.svn.wordpress.org/trunk@21333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-25 18:06:13 +00:00
nacin
70791f60b9 Deprecate sticky_class() in favor of post_class(). props solarissmoke, fixes #16675.
git-svn-id: http://core.svn.wordpress.org/trunk@21253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-09 21:10:59 +00:00
markjaquith
c4205b38a4 Do not store post_excerpt in a temporary variable when we can just return it directly. props niallkennedy. fixes #21041
git-svn-id: http://core.svn.wordpress.org/trunk@21159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-28 19:26:06 +00:00
nacin
4e8f4e57d1 Fix validation issue in get_the_password_form() caused by wpautop(). see #21018 for trunk.
git-svn-id: http://core.svn.wordpress.org/trunk@21124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-26 03:20:51 +00:00