`$initial` shouldn't be loosely compared to `true` in `get_calendar()`.
`current_user_can()` shouldn't be loosely compared to `false` in `kses_init()`
`$get_all` shouldn't be loosely compared to `true` in `get_blog_details()`.
`is_array()` and `in_array()` shouldn't be loosely compared in `wpmu_validate_user_signup()`.
`$result` should by strictly compared in `check_ajax_referer()`.
`wp_verify_nonce()` should by strictly compared in `_show_post_preview()`.
`is_user_logged_in()` should not be loosly compared against `false` in `wp-signup.php`.
See #32444.
Built from https://develop.svn.wordpress.org/trunk@32733
git-svn-id: http://core.svn.wordpress.org/trunk@32704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Clarify `@return` values where necessary.
In `wp_delete_post_revision()`, `wp_delete_post()` doesn't return `WP_Error`, so that check can be removed.
`wp_revisions_to_keep()` always returns an `int`, so `wp_revisions_enabled()` can use strict comparison.
See #32444.
Built from https://develop.svn.wordpress.org/trunk@32621
git-svn-id: http://core.svn.wordpress.org/trunk@32591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Variables in DocBlocks should be backtick-escaped
* Parameter and return types should be as specific as possible
* `@param` types and variables should align with each other, but not intentionally with the `@return` description
See #30230.
Built from https://develop.svn.wordpress.org/trunk@30284
git-svn-id: http://core.svn.wordpress.org/trunk@30284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.
Fixes#30191.
Built from https://develop.svn.wordpress.org/trunk@30105
git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `wp_save_post_revision_post_has_changed` filter which can be used to determine if a post has been changed, and therefore if a revision should be created for a post.
* `wp_get_revision_ui_diff` filter which can be used to filter the fields displayed in the post revision diff UI.
* `wp_creating_autosave` action which is fired just before an autosave is created.
See #20564.
Props mattheu, adamsilverstein.
Built from https://develop.svn.wordpress.org/trunk@30091
git-svn-id: http://core.svn.wordpress.org/trunk@30091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Since `orderby` in `WP_Query` can accept space-delimited sets, yet only one `order` value: when multiple values are passed (and `DESC` is the order), the default sort order `ASC` is being applied to all values before the last in the set.
* There is a unit test that sporadically fails since 3.6 in `tests/post/revision` due to multiple posts having the same `post_date` from being added so rapidly
* When ordering revisions in `wp_get_post_revisions()`, order by `post_date ID`
* Change the `order` value in `wp_get_post_revisions()` to `ASC`. This will produce SQL like: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC`. Previously, this would have produced SQL like: `ORDER BY $wpdb->posts.post_date DESC`, and with the addition of ` ID`: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID DESC`. Clearly, wrong. The original SQL produced: `ORDER BY $wpdb->posts.post_date DESC`. As such, return the reversions in reverse order using `array_reverse()`. Not doing so would break "Preview Changes."
* Add unit tests to assert that all of this works.
* All existing unit tests pass with the change to ordering multiple `orderby`s in `WP_Query`.
* In the future, we should support independent `order` for each `orderby`, see #17065.
Props SergeyBiryukov, wonderboymusic.
Fixes#26042.
Built from https://develop.svn.wordpress.org/trunk@28541
git-svn-id: http://core.svn.wordpress.org/trunk@28367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Eliminates the bloated Revisions meta box in favor of 'Revisions: #' in the publish box.
* Adds ability to compare autosave to current post, when revisions are disabled.
* Makes autosaves stand out visually, including "Restore This Autosave".
Also:
* Adds missing capability check for restoring a revision.
* When no revision matches the post's current modified time, avoid marking an autosave as 'current'.
* Fixes wp_get_post_autosave() to return an autosave even when revisions are disabled.
* Add 'check_enabled' arg to wp_get_post_revisions(); false avoids the wp_revisions_enabled() check.
* Adds a responsive slider that is narrower for fewer versions. props markjaquith.
see #24804.
git-svn-id: http://core.svn.wordpress.org/trunk@24790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Much simpler PHP API
* Cleaner and more Backbone-y JS API
* Consequently, does batch queries; this now scales up to hundreds of revisions
Currently missing, but much easier considering the cleaned up base:
* Compare two mode
* RTL
props koopersmith, nacin, adamsilverstein, ocean90. see #24425
git-svn-id: http://core.svn.wordpress.org/trunk@24520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Searchable, better editing tools
* Less cluttered Post Format UI
props kovshenin, DrewAPicture. see #24009
git-svn-id: http://core.svn.wordpress.org/trunk@24034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Store the post format as meta on revisions (including autosaves).
- Add post formats data (post meta) when autosaving.
- Only add non-empty post formats data to revisions.
- Correct the post format when previewing a published post.
Props kovshenin, see #19570, see #20564.
git-svn-id: http://core.svn.wordpress.org/trunk@23928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- 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
* 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
* 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