The new 'post_edit_category_parent_dropdown_args' provides parity with other
places in wp-admin where `wp_dropdown_categories()` args are filtered, such as
'taxonomy_parent_dropdown_args'.
Props theMikeD.
Fixes#33026.
git-svn-id: https://develop.svn.wordpress.org/trunk@33682 602fd350-edb4-49c9-b593-d223f7449a82
Opted not to use the multi-function DocBlock syntax in the name of not taking shortcuts in documentation for the sake of brevity.
Props Alphawolf for the initial patch.
See #28806
git-svn-id: https://develop.svn.wordpress.org/trunk@33671 602fd350-edb4-49c9-b593-d223f7449a82
* Introduce `is_post_type_viewable( $post_type_object )`
* Separate the HTML bits from the translatable bits in the `post` messages array in `edit-form-advanced.php`
* Don't show certain UI pieces when a post is not viewable on the front end
When a custom post type item is not viewable on the front end, we don't want to show links to View it (on the front end) all over the admin. We also want to hide the Preview link, et al. We also want our admin messages to not contain said links.
Custom post types with `public_queryable` set to `false` are not viewable on the front end.
`'page'` is viewable on the front end, but `'page'` is a `_builtin` type, and `public_queryable` is set to `false` when it is registered - see `WP::parse_request()` for when `public_queryable` gets used.
This is confusing, but also somewhat straightforward: to determine if a post type is viewable on the front end, we can check one way for `_builtin => true` and another way for `_builtin => false`:
`$post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public )`
If a post type is `publicly_queryable`, it's viewable. If that value is `false`, it is viewable if it's a `_builtin` type that is also `public`.
I am in search of edge cases, so this shall land.
Props wonderboymusic, DrewAPicture.
See #17609.
git-svn-id: https://develop.svn.wordpress.org/trunk@33666 602fd350-edb4-49c9-b593-d223f7449a82
* Ensure that dynamic bubble counts are in sync by `comment_post_ID`
* Scope `:animated` to `#the-comment-list`
See #11200.
git-svn-id: https://develop.svn.wordpress.org/trunk@33662 602fd350-edb4-49c9-b593-d223f7449a82
* In a view that initially has comments, but they get removed due to user actions: show the `No Items` row instead of bombing out and showing nothing (which looks broken)
* To accomplish this, in `WP_Comments_List_Table::display()`: call `->display_rows_or_placeholder()` instead of `->display()`
* Listen for the end of row `.fadeOut()`s if necessary using jQuery Promises
Fixes#11200.
git-svn-id: https://develop.svn.wordpress.org/trunk@33657 602fd350-edb4-49c9-b593-d223f7449a82
* Show count next to "Approved"
* Properly increment/decrement counts when row actions are clicked
* In `_wp_ajax_delete_comment_response()`, return the comment's `status` with the `supplemental` data
* Handle counts properly on each scenario of `undo`
See #11200.
git-svn-id: https://develop.svn.wordpress.org/trunk@33655 602fd350-edb4-49c9-b593-d223f7449a82
`LIST` & `NLST` by default on some servers require the `-a` flag to view hidden files (ie. `.maintenance`)
Although we could simply pass the `-a` flag to `NLST`, opting to use `LIST` which we use elsewhere should mean less chance of server incompatibilities.
Props jcroucher.
Fixes#28013.
git-svn-id: https://develop.svn.wordpress.org/trunk@33648 602fd350-edb4-49c9-b593-d223f7449a82
The existing invalid cron entries will not be purged automatically (as the 'timestamp' is never matched) so we do this ourselves.
Props mechter for noticing!
See #30261.
Fixes#33423 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@33646 602fd350-edb4-49c9-b593-d223f7449a82
Some custom list tables override enough methods for the column definition fallback to never kick in, so let's ensure that toggling columns only applies when a primary column is defined in some way. We also need to show a toggle button when we can when there are no row actions.
props Chouby, obenland, ocean90.
fixes#33313.
git-svn-id: https://develop.svn.wordpress.org/trunk@33623 602fd350-edb4-49c9-b593-d223f7449a82
After [33023] users would always be notified, this restores previous behavior.
Props markjaquith, ocean90.
Fixes#33358.
git-svn-id: https://develop.svn.wordpress.org/trunk@33620 602fd350-edb4-49c9-b593-d223f7449a82
[32814] introduced a routine to split shared terms, which was run during the
regular WP database upgrade. This turned out to be problematic because plugins
are not loaded during the db upgrade (due to `WP_INSTALLING`), with the result
that plugins were not able to hook into the 'split_shared_term' action during
the bulk split. We work around this limitation by moving the term splitting
routine to a separate process, triggered by a wp-cron hook.
Props boonebgorges, Chouby, peterwilsoncc, pento, dd32.
Fixes#30261.
git-svn-id: https://develop.svn.wordpress.org/trunk@33615 602fd350-edb4-49c9-b593-d223f7449a82
Also avoid PHP notices because of orphaned comments in the comments list table.
Includes unit test.
props pento, dd32.
fixes#33154.
git-svn-id: https://develop.svn.wordpress.org/trunk@33614 602fd350-edb4-49c9-b593-d223f7449a82
The pre-3.4 theme previewer doesn't work when using a static front page.
We kept the old theme preview for no-JS and some browsers that were less capable. But since browsers are doing a better job today we don't need to continue fixing/shipping this legacy code. Bye!
fixes#33178.
git-svn-id: https://develop.svn.wordpress.org/trunk@33492 602fd350-edb4-49c9-b593-d223f7449a82
The comments list table suffers from "wall of text" problems, which the two plain text links compounded.
props obenland. fixes#33149.
git-svn-id: https://develop.svn.wordpress.org/trunk@33490 602fd350-edb4-49c9-b593-d223f7449a82
* Merge two strings about an invalid comment ID.
* Add missing context to 'Mark as Spam' string.
* Merge two 'In Response To' strings, replace redundant context with a translator comment.
props pavelevap.
fixes#32334.
git-svn-id: https://develop.svn.wordpress.org/trunk@33436 602fd350-edb4-49c9-b593-d223f7449a82
This will duplicate an image that doesn't need cropping once and will skip
creating new images and custom sizes if the selected image has the `site-icon`
context.
Fixes#33011.
git-svn-id: https://develop.svn.wordpress.org/trunk@33356 602fd350-edb4-49c9-b593-d223f7449a82
* Monkey patches imgAreaSelect library to support touch events.
* Removes Settings version of Site Icon since it would have been the same flow.
* Removes default value for Customizer setting - there is no default favicon.
Fixes#16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@33329 602fd350-edb4-49c9-b593-d223f7449a82
DRY the logic for stickies in `wp_xmlrpc_server` by introducing `->_toggle_sticky()`.
Props wonderboymusic, obenland, chriscct7.
Fixes#20662.
git-svn-id: https://develop.svn.wordpress.org/trunk@33325 602fd350-edb4-49c9-b593-d223f7449a82
Allows plugins and themes to use `WP_Customize_Cropped_Image_Control` without
having to define their own way of saving the cropped image.
Props celloexpressions for initial patch.
Fixes#29211.
git-svn-id: https://develop.svn.wordpress.org/trunk@33280 602fd350-edb4-49c9-b593-d223f7449a82
* In `->handle_row_actions()`, bail immediately if `$primary` and `$column_name` do not match. Saves us a nesting level and avoids declaring code that is unusable.
* In `WP_List_Table::single_row_columns()`, allow `_column_{$name}` to be called dynamically by core to avoid having to override the entirety of `->single_row_columns()` in `WP_MS_Users_List_Table` and `WP_Posts_List_Table`
* In `WP_MS_Sites_List_Table`, `id` is not a column.
Props wonderboymusic, paulwilde.
Fixes#29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@33270 602fd350-edb4-49c9-b593-d223f7449a82
Since `WP_List_Table::get_default_primary_column()` can be overridden in a subclass and columns can be further filtered, it is possible to end up with a primary column that no longer exists. This is particularly evident in list tables for custom post types that have been altered via filter.
props ocean90.
fixes#32996.
git-svn-id: https://develop.svn.wordpress.org/trunk@33266 602fd350-edb4-49c9-b593-d223f7449a82
This works around a bug where custom update handlers are injecting an update into an empty transient, malforming the transient and causing update failures.
Fixes#32198 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@33257 602fd350-edb4-49c9-b593-d223f7449a82
Falling back to Apple app icons is deprecated behavior and will not work
forever. 192px is the recommended size for that icon.
Props kraftbj.
Fixes#32964.
git-svn-id: https://develop.svn.wordpress.org/trunk@33202 602fd350-edb4-49c9-b593-d223f7449a82
* Simplify URLs used for row actions to remove messaging and site domain/path.
* Use confirmation messaging from a managed list of actions when handling the request.
* Find the site address from the site ID rather than using information passed in the URL.
Fixes#32963.
git-svn-id: https://develop.svn.wordpress.org/trunk@33173 602fd350-edb4-49c9-b593-d223f7449a82
It is now plain text in the comments list table's "In Response To" column, where it was visually a bit confusing to have the bubble. For other list tables, it now shows a little notification bubble with the number of pending comments. The bubble and notification become plain text in the responsive list table view. It also shows no bubble when there are no comments at all, reducing some of the visual noise.
props picard102, afercia, karinchristen.
fixes#32152.
git-svn-id: https://develop.svn.wordpress.org/trunk@33155 602fd350-edb4-49c9-b593-d223f7449a82
Second part of the Site Icon feature after [32994] introduced it for Settings.
Props celloexpressions.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@33154 602fd350-edb4-49c9-b593-d223f7449a82
In step with the UI provided by `wp-admin/network/users.php`, super admin privileges must be removed before a user can be deleted through the API.
Props @johnjamesjacoby, @jeremyfelt.
Fixes#32935.
git-svn-id: https://develop.svn.wordpress.org/trunk@33143 602fd350-edb4-49c9-b593-d223f7449a82
Without a primary column defined, nothing shows in the responsive view at all, which is bad.
props mordauk.
see #25408.
git-svn-id: https://develop.svn.wordpress.org/trunk@33104 602fd350-edb4-49c9-b593-d223f7449a82
Adding the `.wp-list-table` class gets us a few responsive goodies for free. And now it won't show a strange button outline.
see #32395.
git-svn-id: https://develop.svn.wordpress.org/trunk@33101 602fd350-edb4-49c9-b593-d223f7449a82
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@33096 602fd350-edb4-49c9-b593-d223f7449a82
This also allows us to leverage the builtin `suggestedWidth` and
`suggestedHeight` parameters to convey the expected image size.
Props ocean90.
Fixes#32860.
git-svn-id: https://develop.svn.wordpress.org/trunk@33075 602fd350-edb4-49c9-b593-d223f7449a82
Additionally fixes an incorrect conditional in [33057] which would result in the usermeta index being altered twice on Multisite updates.
See #32154
git-svn-id: https://develop.svn.wordpress.org/trunk@33058 602fd350-edb4-49c9-b593-d223f7449a82
This change does the following things
* Allows utf8mb4 for the MySQL extension
* Re-runs the utf8->utf8mb4 conversion for single sites, this will do nothing for tables already converted
* Re-runs the utf8->utf8mb4 conversion for global tables in multisite when the environment supports utf8mb4
* Removes upgrade_420() calling as upgrade_430() will perform those changes now instead
The index shortenings should have still taken place on utf8 sites previously, so there's no need to run those again.
Props kovshenin, pento, dd32
Fixes#32127 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@33055 602fd350-edb4-49c9-b593-d223f7449a82
Using Jcrop's `trueSize` argument also allows us to get rid of all that behind
the scenes temp image creating and back and forth calculating of image sizes.
Props tyxla for initial patch.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@33053 602fd350-edb4-49c9-b593-d223f7449a82
* Generate the password for the user
* More tightly integrate password strength meter
* Warn on weak passwords
see #32589
props MikeHansenMe, adamsilverstein, binarykitten
git-svn-id: https://develop.svn.wordpress.org/trunk@33023 602fd350-edb4-49c9-b593-d223f7449a82
Instead of truncating columns, the data that's already in the markup can now be toggled into view. Only seems appropriate to celebrate four years of contributing by finally doing the first thing I ever mocked up.
Known issues / concerns:
* Custom list tables that don't define a primary column will show nothing at all. These are not extremely common, as `WP_List_Table` isn't really recommended for plugin consumption, but it happens. We need to come up with some kind of fallback.
* Some visual elements, particularly whitespace, could use refining.
* Needs a11y review.
* Touch performance on iOS feels sluggish - is there anything we can do about that?
* Would this be better accordion-style (only one expanded at a time)?
* Is `wp_strip_all_tags()` good enough for column titles that have HTML in them? It's essentially a workaround for the fact that core's comments column does that for the icon, which maybe it shouldn't. Perhaps worth another ticket, as a markup change would be fairly independent.
* Visual hierarchy is not great when expanded (also worthy of another ticket).
* Quick edit now becomes noticeably more annoying to cancel out of, as you have to scroll all the way down and you lose your position from before it was opened. Again, worthy of another ticket.
props Michael Arestad, helen.
see #32395.
git-svn-id: https://develop.svn.wordpress.org/trunk@33016 602fd350-edb4-49c9-b593-d223f7449a82
- Add support for the Text editor.
- Add auto-scrolling when the caret moves out of the viewport while the user is typing (similarly to editor-expand).
- Add auto-resize for the textarea.
See #32706.
git-svn-id: https://develop.svn.wordpress.org/trunk@32999 602fd350-edb4-49c9-b593-d223f7449a82
This v1 marries Jetpack's Site Icon module with the Media Modal, reusing code
from the Custom Header admin. For now, the core-provided icons will be limited
to a favicon, an iOS app icon, and a Windows tile icon, leaving `.ico` support
and additional icons to plugins to add.
Props obenland, tyxla, flixos90, jancbeck, markjaquith, scruffian.
See #16434.
git-svn-id: https://develop.svn.wordpress.org/trunk@32994 602fd350-edb4-49c9-b593-d223f7449a82
PHP7 is deprecating PHP4 style constructors, so we need to modify our code to have _construct methods that fire before the named PHP4 style constructors. The PHP4 style constructors will call the PHP5 style constructor in case it is being called directly (usually via parent::METHOD).
This modifies external libraries to add PHP5 style constructors, but doesn't add a notice for when they are used. In WordPress core code, PHP4 style constructors are being given a call to _deprecated_constructor. To the PHP4 style constructor I say "I know that I can't take no more | It ain't no lie | I wanna see you out that door | Baby, bye, bye, bye..."
Upstream: https://wiki.php.net/rfc/remove_php4_constructors
Props jdgrimes, netweb, jorbin
See #31982
git-svn-id: https://develop.svn.wordpress.org/trunk@32990 602fd350-edb4-49c9-b593-d223f7449a82
It sets a redundant relationship with all checkboxes in its column and also conveys wrong information for screen readers.
props afercia, valendesigns.
see #31654.
git-svn-id: https://develop.svn.wordpress.org/trunk@32984 602fd350-edb4-49c9-b593-d223f7449a82
- Save a draft before opening the standard editor window.
- While saving a post show Saving... instead of Publish for the main visible part of the split button (same as the Save Draft button before).
See #32757.
git-svn-id: https://develop.svn.wordpress.org/trunk@32983 602fd350-edb4-49c9-b593-d223f7449a82
First step towards restoring a good heading structure in wp-admin.
The previous `<h1>` contained the site title and a link to the front page and was removed with the toolbar refactoring in 3.2.
Props joedolson, afercia.
Fixes#31650.
git-svn-id: https://develop.svn.wordpress.org/trunk@32974 602fd350-edb4-49c9-b593-d223f7449a82
This will avoid partially deleting an item during update which has inconsistent permissions.
This change only affects those using the direct & ssh transports as FTP's is_writable() currently always returns `true`.
Fixes#30921
git-svn-id: https://develop.svn.wordpress.org/trunk@32854 602fd350-edb4-49c9-b593-d223f7449a82
Links used as UI controls that are not real links but act as buttons, should be buttons.
Props afercia.
Fixes#32494.
git-svn-id: https://develop.svn.wordpress.org/trunk@32844 602fd350-edb4-49c9-b593-d223f7449a82
Lessens user confusion and the likelyhood of misusing custom links
to add menu items for posts.
Props bcole808.
Fixes#32440.
git-svn-id: https://develop.svn.wordpress.org/trunk@32842 602fd350-edb4-49c9-b593-d223f7449a82
Provides parity with the 'View All' tab of post type meta boxes in Appearance > Menus.
Props jpyper, chriscct7.
Fixes#19365.
git-svn-id: https://develop.svn.wordpress.org/trunk@32833 602fd350-edb4-49c9-b593-d223f7449a82
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override - there is a small amount of logic that requires overriding, otherwise it is largely the same as the parent method
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32757 602fd350-edb4-49c9-b593-d223f7449a82
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32756 602fd350-edb4-49c9-b593-d223f7449a82
* Move the giant `switch` statement into methods
* Call `->single_row_columns()`, which we now override - it could inherit from `WP_List_Table` if we can find a way to handle the `id` column. When that happens, we can ditch this method.
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32755 602fd350-edb4-49c9-b593-d223f7449a82
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32754 602fd350-edb4-49c9-b593-d223f7449a82
* Move the giant `switch` statement into methods
* Call `-single_row_columns()`, which it inherits from `WP_List_Table`
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32753 602fd350-edb4-49c9-b593-d223f7449a82
In `columns.hidden()`, which lives in `common.js`, don't return items with no `id`.
This was resulting in options like `manageedit-postcolumnshidden` containing a serialized array with random empty items.
Props afercia, wonderboymusic.
Fixes#32466.
git-svn-id: https://develop.svn.wordpress.org/trunk@32751 602fd350-edb4-49c9-b593-d223f7449a82
Break apart the giant `switch` statement in `->single_row()` into `column_{$column_name}` methods.
To maintain the `->single_row_columns( $item )` interface, add a property, `$current_level`, to allow access to `$level`.
This list table class is now easier to subclass.
Props joehoyle, wonderboymusic.
See #29881.
git-svn-id: https://develop.svn.wordpress.org/trunk@32740 602fd350-edb4-49c9-b593-d223f7449a82
* `get_terms()` can return `WP_Error`, so its return value should be checked before traversing.
* The 2nd call to `get_terms()` can be removed, it is redundant #OPTIMIZATION
See #32444.
git-svn-id: https://develop.svn.wordpress.org/trunk@32739 602fd350-edb4-49c9-b593-d223f7449a82
* `get_the_terms()` can return `WP_Error`, so its return value should be checked before traversing.
* Correct the `@param` doc blocks
See #32444.
git-svn-id: https://develop.svn.wordpress.org/trunk@32738 602fd350-edb4-49c9-b593-d223f7449a82
Since the primary column is not going to be alterable for plugins and MS themes, we don't need to check in on it.
see #25408.
git-svn-id: https://develop.svn.wordpress.org/trunk@32723 602fd350-edb4-49c9-b593-d223f7449a82
Why are people manually setting `$_column_headers` other than because somebody else told them to? Maybe time will tell.
props kovshenin.
see #25408.
git-svn-id: https://develop.svn.wordpress.org/trunk@32722 602fd350-edb4-49c9-b593-d223f7449a82
Screen readers will now introduce the group of radio buttons.
Also brings the meta box to parity with Press This.
Props joedolson, afercia.
Fixes#26160.
git-svn-id: https://develop.svn.wordpress.org/trunk@32720 602fd350-edb4-49c9-b593-d223f7449a82
* Build `$blogname` identically when creating action link messaging.
* Remove the trailing slash from URLs for a better UI.
See #32434.
git-svn-id: https://develop.svn.wordpress.org/trunk@32719 602fd350-edb4-49c9-b593-d223f7449a82
* Better support for arbitrary domain/path combinations by displaying the URL in the primary column rather than Path or Domain.
* Show a cached count of total users per site as a more useful data point rather than the first 5 users.
* Clear that cached count of users for a site when a user is added to the site via `add_user_to_blog()`.
Props @ocean90.
Fixes#32434.
git-svn-id: https://develop.svn.wordpress.org/trunk@32718 602fd350-edb4-49c9-b593-d223f7449a82
* Avoid notices in custom list tables that manually set `$_column_headers`. Any plugins using this for a specific purpose should update.
* Restore a special class name in the users list table.
props georgestephanis, stephdau.
see #25408.
git-svn-id: https://develop.svn.wordpress.org/trunk@32717 602fd350-edb4-49c9-b593-d223f7449a82
They don't add valuable information and are redundant.
Reduces annoyance for screen reader users.
Props afercia.
Fixes#32535.
git-svn-id: https://develop.svn.wordpress.org/trunk@32694 602fd350-edb4-49c9-b593-d223f7449a82
Removes title attributes where reasonable and uses accessible hidden text.
Screen readers will now correctly read out all available information.
Props afercia, rianrietveld.
Fixes#32028.
git-svn-id: https://develop.svn.wordpress.org/trunk@32693 602fd350-edb4-49c9-b593-d223f7449a82
It is still available in screen options. This also gives the "Navigation Label", a crucial field, the room it really deserves.
props paulwilde.
fixes#32218.
git-svn-id: https://develop.svn.wordpress.org/trunk@32691 602fd350-edb4-49c9-b593-d223f7449a82
This gives us more space for the title and row actions, and will make a responsive list table enhancement significantly easier.
props bradt for the initial patch.
fixes#29993 and #32255. see #32509 and #32395.
git-svn-id: https://develop.svn.wordpress.org/trunk@32687 602fd350-edb4-49c9-b593-d223f7449a82
These shouldn't be able to have their primary column reassigned by default. Also removes the `has-row-actions` class as these list tables always have row actions visible and the JS for visual toggling conflicts. The `column-primary` class remains.
props stephdau.
see #25408.
git-svn-id: https://develop.svn.wordpress.org/trunk@32686 602fd350-edb4-49c9-b593-d223f7449a82
- Remove the old DFW.
- Add back-compat stub for wp-fullscreen.js.
- Keep wp_ajax_wp_fullscreen_save_post() for now.
See #30949.
git-svn-id: https://develop.svn.wordpress.org/trunk@32677 602fd350-edb4-49c9-b593-d223f7449a82
If the function has no need for `@param` or `@return`, do an archeaological dig to find `@since`.
See #32444.
git-svn-id: https://develop.svn.wordpress.org/trunk@32672 602fd350-edb4-49c9-b593-d223f7449a82