Commit Graph

584 Commits

Author SHA1 Message Date
desrosj
85eb073748 i18n: Remove some translation domains accidentally included in [43762], [44122].
Moves [43764] to trunk.

Fixes #45110.
Built from https://develop.svn.wordpress.org/trunk@44124


git-svn-id: http://core.svn.wordpress.org/trunk@43954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 22:26:27 +00:00
desrosj
13226b445e Block Editor: Add helper functions for displaying the editor.
`use_block_editor_for_post()` and `use_block_editor_for_post_type()` determine if the block editor should be loaded.

`get_block_categories()` and `get_block_editor_server_block_settings()` provide data be included while the block editor is loading.

Props pento.

Merges [43762] to trunk.

See #45110.
Built from https://develop.svn.wordpress.org/trunk@44122


git-svn-id: http://core.svn.wordpress.org/trunk@43952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 22:25:11 +00:00
John Blackbourn
47d32decd6 Docs: Correct and improve various inline documentation.
See #42505

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


git-svn-id: http://core.svn.wordpress.org/trunk@43411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-27 14:28:26 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Andrew Ozz
06725cf28d Move scheduling of old auto-draft posts deletion to get_default_post_to_edit() (where auto-drafts are created).
Fixes #44337.
Built from https://develop.svn.wordpress.org/trunk@43338


git-svn-id: http://core.svn.wordpress.org/trunk@43166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-06-28 02:26:22 +00:00
Andrew Ozz
3266b10d04 Privacy: add "Mine" filter for media similarly to posts and comments.
Props audrasjb.
See #43820.
Built from https://develop.svn.wordpress.org/trunk@43056


git-svn-id: http://core.svn.wordpress.org/trunk@42885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-01 15:43:22 +00:00
John Blackbourn
b13e73d05c Docs: Document more parameters and properties using typed array notation.
See #41756

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


git-svn-id: http://core.svn.wordpress.org/trunk@42705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-25 18:10:32 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Gary Pendergast
c90cfa3b50 General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Boone Gorges
2322b40358 Introduce meta_box_sanitize_cb taxonomy argument.
The `meta_box_cb` argument was introduced in [25572] to allow plugin
authors to provide a custom callback for rendering their taxonomy's meta
box on the post edit screen. However, the routine used to handle the saving
of these custom taxonomy meta boxes was not customizable, but was instead
based simply on whether the taxonomy was hierarchicaly. See [13535].

The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
non-hierarchical taxonomies and the "category" routine for hierarchical ones,
thereby maintaining the current default behavior. Developers can override this
when the data passed from their `meta_box_cb` differs.

Props boonebgorges, ZaneMatthew, stephenharris.
Fixes #36514.
Built from https://develop.svn.wordpress.org/trunk@42211


git-svn-id: http://core.svn.wordpress.org/trunk@42040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-21 03:15:50 +00:00
Sergey Biryukov
af4cda27cc Posts, Post Types: Simplify the wording in post locking notice.
Props munyagu.
Fixes #42023.
Built from https://develop.svn.wordpress.org/trunk@41706


git-svn-id: http://core.svn.wordpress.org/trunk@41540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:11:48 +00:00
Sergey Biryukov
3d26fab9f6 Post Formats: In bulk_edit_posts(), set post format before the post is updated, for consistency with edit_post().
This makes sure that plugins hooked to `save_post` get the right post format.

Props Chouby, SergeyBiryukov.
Fixes #41396.
Built from https://develop.svn.wordpress.org/trunk@41187


git-svn-id: http://core.svn.wordpress.org/trunk@41027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-30 14:41:42 +00:00
Drew Jaynes
5c075e5af7 Docs: Remove a few more superfluous @package WordPress and @subpackage notations outside of file headers missed in [40988].
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 17:11:41 +00:00
Drew Jaynes
bd2173f42c Docs: Remove an unnecessary @package tag from the DocBlock for post_preview().
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:39:41 +00:00
Drew Jaynes
ba40430e89 Docs: Add a valid return type for post_preview() and improve the DocBlock summary.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:37:42 +00:00
Sergey Biryukov
9fb2e79b57 Posts, Post Types: In wp_check_post_lock(), check if the user with lock exists and return false otherwise.
Props arshidkv12, 1naveengiri.
Fixes #39888.
Built from https://develop.svn.wordpress.org/trunk@40424


git-svn-id: http://core.svn.wordpress.org/trunk@40322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:09:43 +00:00
Sergey Biryukov
bef3ff1377 Posts, Post Types: Improve the docs for wp_check_post_lock() and wp_set_post_lock().
See #39888.
Built from https://develop.svn.wordpress.org/trunk@40423


git-svn-id: http://core.svn.wordpress.org/trunk@40321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:02:42 +00:00
Sergey Biryukov
93d4caaccd Docs: Add missing @param tag for show_post_locked_dialog filter.
Props keesiemeijer.
Fixes #39479.
Built from https://develop.svn.wordpress.org/trunk@39710


git-svn-id: http://core.svn.wordpress.org/trunk@39650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 21:59:04 +00:00
James Nylen
505e135f4c REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added
via the `posts_clauses` filter and the `_filter_query_attachment_filenames()`
function.  This moves `_filter_query_attachment_filenames()` from
`wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be
applied in the same manner in the REST API media endpoint.

Props jblz, tyxla.
Fixes #39092.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-13 14:09:42 +00:00
Dominik Schilling
3dc47839db Docs: Document the usage of the global $wpdb in _filter_query_attachment_filenames().
Props mt8.biz.
Fixes #38973.
Built from https://develop.svn.wordpress.org/trunk@39390


git-svn-id: http://core.svn.wordpress.org/trunk@39330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-30 23:20:42 +00:00
Sergey Biryukov
acc30b09d7 Text Changes: Merge some duplicate strings with the same meaning in error messages, adjust some other strings for consistency and accuracy.
Props ramiy, SergeyBiryukov.
Fixes #38808.
Built from https://develop.svn.wordpress.org/trunk@39278


git-svn-id: http://core.svn.wordpress.org/trunk@39218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-17 15:53:33 +00:00
John Blackbourn
babd79fb36 Posts, Post Types: Prevent users from being able to delete a protected meta field from a post.
Previously a user could remove a protected meta field by using their browser developer tools to alter the form field properties in the Custom Fields meta box, given that they know the ID of the protected meta field. This change prevents this by preventing any change to a protected meta field, including changing its key.

Props ajoah, johnbillion, peterwilsoncc
Fixes #38293

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


git-svn-id: http://core.svn.wordpress.org/trunk@39004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 19:30:32 +00:00
Joe McGill
173f9b6f22 Media: Better handling of JOINs when searching filenames.
Following [38625], any media searches that already included JOINs,
e.g., `tax_queries`, would get trampled when we joined the post meta
table to search for filenames. This preserves existing JOINs and
also only applies the `_filter_query_attachment_filenames()` filter
when a search query is being performed.

Props flixos90, joemcgill.
Fixes #22744.
Built from https://develop.svn.wordpress.org/trunk@38733


git-svn-id: http://core.svn.wordpress.org/trunk@38676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 19:51:30 +00:00
Joe McGill
8f36a570cb Media: Make media library searchable by filename.
This applies a new private function, `_filter_query_attachment_filenames()`,
to the `post_clauses` filter hook during `wp_ajax_query_attachments()` and
`wp_edit_attachments_query_vars()` to include `_wp_attached_file` post meta
in search queries performed from the media library or in a `WP_Media_List_Table`.

Props wonderboymusic, DrewAPicture, joemcgill, swissspidy.
Fixes #22744.
Built from https://develop.svn.wordpress.org/trunk@38625


git-svn-id: http://core.svn.wordpress.org/trunk@38568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 01:45:31 +00:00
Aaron Jorbin
7e811d7120 Permalinks: Ensure Pending Review Posts permalink posts link to the draft
[34670] made the displayed permalink clickable. For posts that were pending review, the permalink wasn't being properly generated so the link wouldn't go to the preview.

Props knutsp, enshrined.
Fixes #37423.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 04:05:31 +00:00
Scott Taylor
d31456b615 Media: add a function, wp_get_additional_image_sizes(), that wraps the retrieval of the global $_wp_additional_image_sizes. Removes 6 global imports.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 04:37:28 +00:00
John Blackbourn
594b88661a Permalinks: Correct the documentation for the get_sample_permalink filter, and improve the documentation for the get_sample_permalink() function.
Props sebastian.pisula for the original patch
Fixes #37682

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


git-svn-id: http://core.svn.wordpress.org/trunk@38213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-17 18:30:30 +00:00
Sergey Biryukov
a7a8585640 Posts, Post Types: Remove a redundant function_exists( 'mb_strlen' ) check in get_sample_permalink_html().
`mb_strlen()` is always available since [32114].

See #30633.
Built from https://develop.svn.wordpress.org/trunk@38147


git-svn-id: http://core.svn.wordpress.org/trunk@38088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-23 13:08:44 +00:00
Dominik Schilling
eb0ee24750 Post Thumbnails: Remove an unused nonce in _wp_post_thumbnail_html().
See #12922.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-22 11:44:28 +00:00
Dominik Schilling
c4dfc0adba Media: Remove global import for $content_width in _wp_post_thumbnail_html().
`$content_width` is unused since [35023].

See #28512.
Built from https://develop.svn.wordpress.org/trunk@38136


git-svn-id: http://core.svn.wordpress.org/trunk@38077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-22 11:40:28 +00:00
Joe McGill
3dbba0fff3 Post Thumbnails: Only update featured images when saving a post.
Previously, changing the post thumbnail of a published post in the edit screen
would immediately apply the change, rather than waiting for the post to be
saved before applying the update. This could lead to someone unintentionally
editing the post thumbnail on a published post, and made it impossible to
preview changes to post thumbnails on published posts before saving the change.

This introduces a new Ajax handler, `wp_ajax_get_post_thumbnail_html()` to
retrieve the HTML for the post thumbnail meta box without updating the post
meta value for `_thumbnail_id`. It also allows post thumbnail changes to be
previewed by passing the `_thumbnail_id` as a query variable to the preview
screen and adding a new filter, `_wp_preview_post_thumbnail_filter()`, which
gets applied to `get_post_metadata` during the post preview process.

Props flixos90.
Fixes #12922.
Built from https://develop.svn.wordpress.org/trunk@38118


git-svn-id: http://core.svn.wordpress.org/trunk@38059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-20 16:24:28 +00:00
Drew Jaynes
31f150080a Docs: Standardize references to "meta box" or "meta boxes" as two distinct words throughout core documentation per the core spelling guide.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-10 00:56:28 +00:00
Drew Jaynes
7eb6471461 Docs: Fix minor formatting and syntax for wp-admin/* elements introduced in 4.6.
See #37318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-09 14:00:31 +00:00
Dominik Schilling
25e66e4f1e Text Changes: Unify permission error messages.
The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.
Built from https://develop.svn.wordpress.org/trunk@37914


git-svn-id: http://core.svn.wordpress.org/trunk@37855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 15:16:29 +00:00
Nikolay Bachiyski
c5d9d5cc18 Admin: escape URL-encoded permalinks
Built from https://develop.svn.wordpress.org/trunk@37801


git-svn-id: http://core.svn.wordpress.org/trunk@37766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 14:46:49 +00:00
Boone Gorges
6d05c7521b Taxonomy: More specific cap check when processing category data on post save.
Props dlh.
Fixes #36379.
Built from https://develop.svn.wordpress.org/trunk@37691


git-svn-id: http://core.svn.wordpress.org/trunk@37657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 01:37:29 +00:00
Drew Jaynes
c3055cc190 Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:01:30 +00:00
Boone Gorges
1e82651504 Pass thumbnail ID to the admin_post_thumbnail_html filter.
Also updates changelog to reflect that `$post->ID` was added in 3.5

Props johnjamesjacoby.
Fixes #36443.
Built from https://develop.svn.wordpress.org/trunk@37196


git-svn-id: http://core.svn.wordpress.org/trunk@37162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-13 16:18:28 +00:00
Aaron Jorbin
1972aa2a2a Add grunt prerelease task
An unintended consequence of improving the precommit task is that when it's time to run a release, more tasks need to get run to verify things. This adds a prerelease task to help fix that situation. grunt prerelease should include tasks that verify the code base is ready to be released to the wild and find all the tears on the mausoleum floor and help Blood stain the Colosseum doors.

See #35557

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


git-svn-id: http://core.svn.wordpress.org/trunk@36898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 05:37:27 +00:00
John Blackbourn
3184328ecb Posts, Post Types: Ensure that non-ASCII characters in attachment slugs aren't shown in urlencoded form in the sample permalink UI.
Fixes #35980

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


git-svn-id: http://core.svn.wordpress.org/trunk@36820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-05 03:56:27 +00:00
Sergey Biryukov
ab0eb71d21 Revisions: Clean up _wp_post_revision_fields():
* Move the array processing to a new function, `_wp_post_revision_data()`.
* Make both functions accept a post array or a `WP_Post` object. 
* Always apply the `_wp_post_revision_fields` filter and pass the post data to it.

Fixes #13382.
Built from https://develop.svn.wordpress.org/trunk@36659


git-svn-id: http://core.svn.wordpress.org/trunk@36626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 00:44:59 +00:00
Andrea Fercia
08510d2e5d Accessibility: after [36000] conditionally print out the aria-describedby attribute on the Featured Image postbox.
Fixes #35076.
Built from https://develop.svn.wordpress.org/trunk@36584


git-svn-id: http://core.svn.wordpress.org/trunk@36551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-19 15:10:28 +00:00
Andrew Ozz
2413e41f8c Do not strip slashes from the whole &_POST when doing autosaves.
Props joehoyle.
Fixes #35408.
Built from https://develop.svn.wordpress.org/trunk@36543


git-svn-id: http://core.svn.wordpress.org/trunk@36510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-17 00:10:27 +00:00
Sergey Biryukov
5540c0b8db Import: Add a missing space to post_exists().
The lack of space resulted in SQL error when searching for posts by content.

Props yetAnotherDaniel, johnbillion.
Fixes #35246.
Built from https://develop.svn.wordpress.org/trunk@36113


git-svn-id: http://core.svn.wordpress.org/trunk@36078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-28 19:07:28 +00:00
Andrea Fercia
6fdd27a1d6 Accessibility: Remove the title attribute from the Featured Image postbox thumbnail.
The title attribute is now replaced with plain text in a `howto` paragraph, as done for example in the Tags postbox.
Adds an `aria-describedby` attribute on the thumbnail link to target the description.
Also, fixes the focus style on the featured image thumbnail.

Fixes #35076.
Built from https://develop.svn.wordpress.org/trunk@36000


git-svn-id: http://core.svn.wordpress.org/trunk@35965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 23:44:26 +00:00
Dominik Schilling
3c0c5e6ad5 List Tables: Revert [34728] and [35482].
Part of [34728] was already reverted in [35682], but the default values still made it impossible to set a default ordering for custom post types.

See #25493.
See #34825.
Built from https://develop.svn.wordpress.org/trunk@35818


git-svn-id: http://core.svn.wordpress.org/trunk@35782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-07 19:16:26 +00:00
Jeremy Felt
714d5885d9 Te Docs: Fix te the misspelling.
Previously, [35793].

Fixes #34888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:32:25 +00:00
Scott Taylor
e649fabb6a Accessibility: add missing alt attributes to a gaggle of <img>s.
Props afercia.
Fixes #34583.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-07 16:12:27 +00:00
Sergey Biryukov
10f3ff1753 Post List Table: Hierarchical post types should not default to sorting by date.
Regression introduced in [34728].

Props ellie.roepken.
Fixes #34473. See #25493.
Built from https://develop.svn.wordpress.org/trunk@35482


git-svn-id: http://core.svn.wordpress.org/trunk@35446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-01 00:49:24 +00:00
Sergey Biryukov
f98136c1b5 Sample permalink: Improve accessibility of changing the permalink on Edit Post screen.
Props afercia.
Fixes #34255.
Built from https://develop.svn.wordpress.org/trunk@35229


git-svn-id: http://core.svn.wordpress.org/trunk@35195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-16 23:02:25 +00:00
Drew Jaynes
217b661703 Docs: Add missing descriptions for the $wpdb global in DocBlocks all the places.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-14 23:44:25 +00:00
Drew Jaynes
ee544e44d5 Docs: Adjust documentation for the $size parameter in the admin_post_thumbnail_size hook doc to clarify the required order of width and height values when an array is passed.
See #34257. See #28512.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 16:22:25 +00:00
Drew Jaynes
2c6e416159 Media: Remove logic for unnecessarily overloading the $content_width global when passing default dimensions used to display the post thumbnail image in the 'Featured Image' meta box.
Updates documentation for the `$size` parameter in `admin_post_thumbnail_size` filter doc.

See #28512.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 17:10:25 +00:00
Drew Jaynes
889a89c2a2 Media: Introduce the admin_post_thumbnail_size filter, which enables manipulation of the image size used to display the post thumbnail in the 'Featured Image' meta box.
This filter has no effect on the image size used to display post thumbnails on the front-end.

Props dboulet, DrewAPicture.
Fixes #28512.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-11 16:54:26 +00:00
John Blackbourn
0e1ecdcbf3 Revert [34917] until the broken test is fixed.
See #13382

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


git-svn-id: http://core.svn.wordpress.org/trunk@34890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 01:04:25 +00:00
Boone Gorges
b0e0323337 Add tests for update_user_caches().
See #24635.
Built from https://develop.svn.wordpress.org/trunk@34918


git-svn-id: http://core.svn.wordpress.org/trunk@34883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-07 22:35:26 +00:00
Helen Hou-Sandí
60431ae239 Permalinks: Slightly lengthen the truncated slug for display.
This brings it closer to the width of the input so there is less jumping around of buttons. We can afford the space now that other buttons in the space are typically no longer there.

fixes #18306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 19:29:24 +00:00
Scott Taylor
594a208753 Post List Table: Ensure that edit.php with no query string produces the proper markup and links in the date column header.
Add 2 methods to `WP_List_Table`, `->get_orderby()` and `->get_order()`. Override the methods in `WP_Posts_List_Table`.

`WP_Posts_List_Table` calls `wp_edit_posts_query()` in `->prepare_items()` which is a wrapper for `wp()`. As such, we can obtain `orderby` and `order` via `get_query_var()`, instead of the URL.

Fixes #25493.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 02:10:25 +00:00
Gary Pendergast
cf173408cd Permalinks: Add pretty permalinks for unattached attachments.
Previously, unattached attachments would have unsightly `/?attachment_id=1` URLs. As we've moved away from attachments being specifically attached to posts, instead being Media items, this has made the unattached URLs a more common occurrence.

We can breath easy once more, knowing that the world is a little bit safer from the horror of unnecessarily ugly URLs.

Props SergeyBiryukov, wonderboymusic, pento.

Fixes #1914.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 09:42:26 +00:00
Helen Hou-Sandí
e976f9b503 Edit: Remove the redundant "View Post" button-link and link the sample permalink.
Previously there were two persistent "View Post" links on an edit screen: next to the permalink and in the toolbar. This would then become three links after a post was published or updated, as a link is also included in the admin notice. This is a lot of redundancy and visual noise for a flow that is not your primary action upon starting to edit a post. The "View Post" link next to the sample permalink was particularly bad because it is styled like a button, but unlike a button, does not keep you on the current screen.

Because the permalink is now linked, there is no highlighted slug that you can click to edit, but rather just the "Edit" button.

props scribu, lessbloat, sabreuse, SergeyBiryukov, DrewAPicture, helen.
see #18306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-28 20:10:26 +00:00
Scott Taylor
82709c30d9 The 'get_sample_permalink_html' filter​'s second parameter can be a post ID or a post object. This is confusing. We should pass the post ID and post object separately, for consistency with 'get_sample_permalink' filter added in [34309].
Props SergeyBiryukov.	
Fixes #33927.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-20 03:26:25 +00:00
Scott Taylor
e47963d1e7 Edit Post: When a post is "Pending Review", the "View Post" link should behave like ot does for drafts and generate a preview link.
Props wpdev101.
Fixes #33541.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-19 16:32:24 +00:00
Scott Taylor
d28e914a06 When applying the 'editable_slug' filter, add a second param that provides more context.
Props MikeSchinkel, jesin.
Fixes #31568.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-19 05:49:24 +00:00
Scott Taylor
04f7a0da2f Add a 'get_sample_permalink' filter.
Props SergeyBiryukov, wenthemes, JustinSainton.
Fixes #22338.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-18 19:28:26 +00:00
Sergey Biryukov
514eb11cf4 Revert unintended change from [34262].
See #33910.
Built from https://develop.svn.wordpress.org/trunk@34263


git-svn-id: http://core.svn.wordpress.org/trunk@34227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 09:09:28 +00:00
Sergey Biryukov
d91fe61405 Docs: Expand the DocBlock for get_default_post_to_edit().
Props rabmalin.
Fixes #33910.
Built from https://develop.svn.wordpress.org/trunk@34262


git-svn-id: http://core.svn.wordpress.org/trunk@34226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 09:06:34 +00:00
John Blackbourn
a5a8ae45a6 Remove outdated references to the preview_post_link filter docs.
See #24345
Props paulwilde

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


git-svn-id: http://core.svn.wordpress.org/trunk@34146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 10:32:31 +00:00
Scott Taylor
54829b6305 Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.
Props TomHarrigan, wonderboymusic.
Fixes #24345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:15:25 +00:00
Scott Taylor
503aa8b76d Move redirect_post() from wp-admin/post.php to wp-admin/includes/post.php.
See #33813.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 21:31:24 +00:00
Scott Taylor
02ae926dfd Round 2 of: We should use ellipses &hellip; / … instead of three dots/periods ... e.g Loading… not Loading...
Props yoavf.
Fixes #32875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 04:39:25 +00:00
John Blackbourn
6d7aeeac03 Don't change the View Post button permalink in the sample permalink HTML when updating the slug on a published or future post.
Fixes #32954
Props boonebgorges, johnbillion

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


git-svn-id: http://core.svn.wordpress.org/trunk@33741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-27 20:57:22 +00:00
Scott Taylor
ef87172270 foreach is a statement, not a function.
See #33491.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 20:28:22 +00:00
Dominik Schilling
a9b3f12826 Heartbeat: Ensure post locks are released.
Built from https://develop.svn.wordpress.org/trunk@33542


git-svn-id: http://core.svn.wordpress.org/trunk@33509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-04 04:54:34 +00:00
Konstantin Obenland
c9a29b0123 Check for all required caps before (un)sticking a post.
In cases where a user has the `edit_others_posts` capability but not
`publish_posts`, it was possible for that user to unstick a post after editing,
since the input field was never made available in that context.

Props ericmann, chriscct7.
Fixes #24153.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-06 22:41:25 +00:00
Konstantin Obenland
a4e803fbd4 Use get_default_comment_status() globally.
Also makes the filter name static and passes the post type for context.

Props valendesigns.
Fixes #31168.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-02 22:32:25 +00:00
Scott Taylor
5c6b63d3a6 if is a statment, not a function.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-16 20:01:25 +00:00
John Blackbourn
02192cb53f Introduce featured_image, set_featured_image, remove_featured_image, and use_featured_image post type labels when registering a post type in order to override the 'Featured Image' text and its related phrases.
Props johnbillion, mordauk, valendesigns.
Fixes #19257.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-31 16:54:27 +00:00
Scott Taylor
282e28ad81 Add @global annotations to (the rest of the?) wp-admin/* files.
Does not include list table file changes.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:06:31 +00:00
Drew Jaynes
7c3e469326 Clarify the DocBlock summary and parameter description for wp_edit_attachments_query_vars().
See [31037]. See #31888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 21:52:25 +00:00
Boone Gorges
62450e9f0f After [31114] and [31323], 'View Post' generated in get_sample_permalink_html() should go to pretty permalink.
`get_permalink()` will return a non-pretty permalink for future posts, which
breaks some user workflows that expect View Post to lead to a page with the
pretty permalink.

Fixes #30910.
Built from https://develop.svn.wordpress.org/trunk@32002


git-svn-id: http://core.svn.wordpress.org/trunk@31981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-04 01:27:28 +00:00
Boone Gorges
60c26865f9 Check that $_POST array index is set before comparing it in post_preview().
This prevents PHP notices in cases where a user with 'edit_others_posts' but
without 'publish_posts' previews another user's posts.

Props tyxla.
Fixes #31760.
Built from https://develop.svn.wordpress.org/trunk@31896


git-svn-id: http://core.svn.wordpress.org/trunk@31875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-26 01:45:26 +00:00
John Blackbourn
bb99536bf5 Introduce a new algorithm for displaying a hierarchical list of post objects in the WP_Posts_List_Table. This reduces processing time, reduces database queries, and substantially reduces memory use on sites with a high number of Pages.
Props nofearinc, rodrigosprimo, nacin, johnbillion.
Fixes #15459

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


git-svn-id: http://core.svn.wordpress.org/trunk@31711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-11 20:46:27 +00:00
Scott Taylor
0ec87e4584 There are a few functions that have the ability to return false instead of a string, so the return value should be checked before being passed to functions that expect string.
These are trivial, but they clear out some Scrutinizer issues.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-09 02:11:28 +00:00
Boone Gorges
72f18cb067 Don't parse empty 'tax_input' keys in edit_post().
This fixes a bug introduced in [31359] where saving a tax_input that contained
only whitespace would result in a random tag being erroneously added to the
post.

See #30615.
Built from https://develop.svn.wordpress.org/trunk@31392


git-svn-id: http://core.svn.wordpress.org/trunk@31373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-09 22:54:28 +00:00
Boone Gorges
b9e661dcae Parse non-hierarchical tag input into term IDs before sending to wp_insert_post().
When editing a post, non-hierarchical taxonomy terms are sent as the
comma-separated list entered into the tax_input metabox. Passing these
values directly to `wp_update_post()` meant that they were interpreted as
term slugs rather than term names, causing mismatches when a typed string
matched the slug of one term and the name of a different term. We fix the
problem by preprocessing tax_input data sent from post.php, converting it to
unambiguous term_ids before saving.

Props boonebgorges, ArminBraun.
Fixes #30615.
Built from https://develop.svn.wordpress.org/trunk@31359


git-svn-id: http://core.svn.wordpress.org/trunk@31340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-06 20:32:22 +00:00
Boone Gorges
eec82f9330 In get_sample_permalink(), override 'future' status before generating permalink.
In [31114], `get_permalink()` was modified to prevent pretty permalinks from
being generated for posts with the 'future' post status. This inadvertently
broke the pretty permalink preview for scheduled posts. The fix is to include
the 'future' status in the list of statuses that `get_sample_permalink()` fakes
as 'publish' before it fetches a permalink.

Props DrewAPicture.
Fixes #30910.
Built from https://develop.svn.wordpress.org/trunk@31323


git-svn-id: http://core.svn.wordpress.org/trunk@31304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-02 16:50:22 +00:00
Drew Jaynes
f3033f34c6 Add missing descriptions to the DocBlocks for various functions in wp-admin/includes/post.php
Props ipm-frommen.
See #31008.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-29 11:32:22 +00:00
Scott Taylor
6704875855 Replace the 3 remaining occurrences of wpspin GIF with spinner.
Props avryl.
Fixes #27482.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 00:33:22 +00:00
Scott Taylor
c5f9a7c26a Respect query vars for taxonomies passed as URL parameters when in grid mode of Media Library.
Fixes #30584.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-03 08:24:22 +00:00
Sergey Biryukov
0ef8e683f2 Revert [28948], which caused a regression.
see #29573 for trunk. see #28350.
Built from https://develop.svn.wordpress.org/trunk@30791


git-svn-id: http://core.svn.wordpress.org/trunk@30781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-08 21:14:23 +00:00
Drew Jaynes
cc4ac906dc Fix a typo in the return description for get_sample_permalink().
Props TobiasBg.
Fixes #30591.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-06 21:46:23 +00:00
Drew Jaynes
23707b1ada Convert various uses of (optional) in core parameter descriptions to use the style prescribed in the inline documentation standards for PHP.
The style for marking parameters optional in inline PHP docs is: `@param type $var Optional. Description. Accepts. Default.`, where Accepts can be omitted on a case-by-case basis.

Props coffee2code.
Fixes #30591.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-06 21:24:45 +00:00
Scott Taylor
2c32752abd Improve various @param docs for src/wp-admin/*.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 01:00:22 +00:00
Drew Jaynes
78bb3e5ff5 Docs Formatting: Backtick-escape inline code for all dynamic hook docs in wp-admin/includes/*.
Also adds a few inline `@see` cross-references as they apply.

Affects DocBlocks for the following hooks:
* `views_{$this->screen->id}`
* `bulk_actions-{$this->screen->id}`
* `manage_{$this->screen->id}_sortable_columns`
* `theme_action_links_$stylesheet`
* `after_theme_row_$stylesheet`
* `install_plugins_table_api_args_$tab`
* `$prefix . plugin_action_links`
* `after_plugin_row_$plugin_file`
* `manage_taxonomies_for_{$post_type}_columns`
* `manage_{$post_type}_posts_columns`
* `manage_{$post->post_type}_posts_custom_column`
* `{$taxonomy}_row_actions`
* `manage_{$this->screen->taxonomy}_custom_column`
* `install_themes_table_api_args_' . $tab`
* `auto_update_ . $type`
* `{$action}_prefilter`
* `admin_head_{$content_func}`
* `nav_menu_items_{$post_type_name}`
* `activate_ . $plugin`
* `deactivate_ . $plugin`
* `edit_{$post_type}_per_page`
* `postbox_classes_{$page}_{$id}`
* `_wp_post_revision_field_$field`
* `manage_{$screen->id}_columns`
* `in_plugin_update_message-{$file}`
* `in_theme_update_message-{$theme_key}`

See #30552.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 11:28:24 +00:00
Drew Jaynes
3ceb75bd8e Specify a type (array) for the $post_data parameter in the DocBlock for wp_autosave().
Props tillkruess.
See #30508.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 10:01:23 +00:00
Boone Gorges
c6e752b063 In get_default_post_to_edit(), let 'post_name' be passed to filter.
Previously, it was being overridden after the default post had been inserted
into the database, making it cumbersome to override with the 'wp_insert_post_data'
filter.

Props danielbachhuber.
Fixes #29847.
Built from https://develop.svn.wordpress.org/trunk@30626


git-svn-id: http://core.svn.wordpress.org/trunk@30616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-29 19:26:23 +00:00
John Blackbourn
cd99d5915f Decode the sample permalink shown to the user. This avoids showing encoded non-Latin characters in the sample permalink.
Fixes #16496
Props linuxologos

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


git-svn-id: http://core.svn.wordpress.org/trunk@30363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-17 03:00:21 +00:00
Gary Pendergast
e61bebdbfc If a saving a post fails, remove any invalid characters (such as emoji) from the primary text fields, then try to save it again.
See #21212.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-14 21:34:22 +00:00
Scott Taylor
7d7a8aa0eb Correct all @return unknown instances.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 06:17:22 +00:00
Scott Taylor
64167f0845 Fill in the @param types for the args for functions missing them in wp-admin/includes/post.php.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:55:22 +00:00