The AP Stylebook changed this in 2011, and we're woefully inconsistent, so let's go with the standard.
props morganestes, voldemortensen, niallkennedy (for patching on the previous AP style).
fixes#26156.
git-svn-id: https://develop.svn.wordpress.org/trunk@33774 602fd350-edb4-49c9-b593-d223f7449a82
When generating a `<ul>` using `wp_list_categories()`, a title `<li>` element
is put at the top of the term list. Current behavior is that this title `<li>`
appears even when no terms are found. The new `hide_title_if_no_cats` param
allows developers to specify that the title should be hidden when the term list
is empty.
Props vilkatis.
Fixes#33460.
git-svn-id: https://develop.svn.wordpress.org/trunk@33764 602fd350-edb4-49c9-b593-d223f7449a82
This changeset also corrects a few parameter descriptions, and adds a few that
were previously missing.
Fixes#33556.
git-svn-id: https://develop.svn.wordpress.org/trunk@33763 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-meta-query.php`
`meta-functions.php`
`meta.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33761 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-tax-query.php`
`taxonomy-functions.php`
`taxonomy.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33760 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-post.php`
`post-functions.php`
`post.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33759 602fd350-edb4-49c9-b593-d223f7449a82
It's important for every file in WordPress, regardless of makeup or architecture, to have its own file header, even if the file contains nothing but a class. When parsed, files and classes are mutually exclusive and should be documented with this in mind.
See [33746]. See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33756 602fd350-edb4-49c9-b593-d223f7449a82
It's important for every file in WordPress, regardless of makeup or architecture, to have its own file header, even if the file contains nothing but a class. When parsed, files and classes are mutually exclusive and should be documented with this in mind.
See [33746]. See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33755 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-roles.php`
`class-wp-role.php`
`class-wp-user.php`
`capbilities-functions.php`
`capbilities.php` contains only top-level code. Class files only contains classes. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33752 602fd350-edb4-49c9-b593-d223f7449a82
The rewrite functions have all kinds of cross-dependencies (like `WP_Query`), so loading the file by itself would have been bizarre (and still is).
Creates:
`rewrite-constants.php`
`rewrite-functions.php`
`class-wp-rewrite.php`
`rewrite.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33751 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-comment-query.php`
`comment-functions.php`
`comment.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33750 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-user-query.php`
`user-functions.php`
`user.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33749 602fd350-edb4-49c9-b593-d223f7449a82
`class-http.php` requires functions from `http.php`, so loading it by itself wouldn't have worked.
Creates:
`class-wp-http-cookie.php`
`class-wp-http-curl.php`
`class-wp-http-encoding.php`
`class-wp-http-proxy.php`
`class-wp-http-streams.php`
`http-functions.php`
`WP_Http` remains in `class-http.php`.
`http.php` contains only top-level code. Class files only contain classes. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33748 602fd350-edb4-49c9-b593-d223f7449a82
The good news is, the point of `wp_json_encode()` is to handle those non-UTF-8 characters. It'll totally just fix them up, no problem.
Anyway, we can just ignore those warnings.
Fixes#33524.
git-svn-id: https://develop.svn.wordpress.org/trunk@33747 602fd350-edb4-49c9-b593-d223f7449a82
Creates:
`class-wp-widget.php`
`class-wp-widget-factory.php`
`widget-functions.php`
`widgets.php` contains only top-level code. Class files only contain classes. Functions file only contains functions.
See #33413.
git-svn-id: https://develop.svn.wordpress.org/trunk@33746 602fd350-edb4-49c9-b593-d223f7449a82
When inserting an image into a post, the values in `wp.media.controller.Library` should not default to linking the image when no user settings are present.
The default display setting value for `link` is now `none`. User settings persist and will override or confirm this value based on user actions.
Props liljimmi, janhenckens, eherman24, wonderboymusic.
Fixes#31467.
git-svn-id: https://develop.svn.wordpress.org/trunk@33729 602fd350-edb4-49c9-b593-d223f7449a82
Since the value of the filter is passed through `sprintf()` it's important to note that any filtered output needs to contain the expected specifiers.
See #31315.
git-svn-id: https://develop.svn.wordpress.org/trunk@33717 602fd350-edb4-49c9-b593-d223f7449a82
This allows the `count` property to reflect the pre-delete state of affairs,
rather than always being 0.
Props nicholas_io.
Fixes#33485.
git-svn-id: https://develop.svn.wordpress.org/trunk@33711 602fd350-edb4-49c9-b593-d223f7449a82
[32523] introduced the `$public_only` parameter to `count_user_posts()`. That
changeset was supposed to pass `$public_only` to the 'get_usernumposts' filter
at the end of the function, but only the documentation was modified, not the
filter itself.
This changeset also fixes an incorrect variable name in the docblock for
the same filter.
Props swisspidy, tmatsuur.
Fixes#33481 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@33710 602fd350-edb4-49c9-b593-d223f7449a82
Add a query var, `title`, that allows you to query posts by `post_title`. To accomplish this now, you have to do something like:
{{{
$tacos = get_posts( [
'post_type' => 'taco',
's' => $name,
'exact' => true,
'sentence' => true,
'post_status' => 'publish',
'fields' => 'ids',
'posts_per_page' => 1
] );
}}}
Adds unit tests.
Fixes#33074.
git-svn-id: https://develop.svn.wordpress.org/trunk@33706 602fd350-edb4-49c9-b593-d223f7449a82
The "month" isn't really a month. It's a WordPress Month. As the docs make clear, it's not about accuracy as much as it about convenience. This adds a missing step in the time convenience constants.
Props egill
Fixes#33397
git-svn-id: https://develop.svn.wordpress.org/trunk@33698 602fd350-edb4-49c9-b593-d223f7449a82
Reverts unnecessary change in [32602] since `array_key_exists()` does actually work with `ArrayIterator` objects.
See #32474.
Fixes#33442.
git-svn-id: https://develop.svn.wordpress.org/trunk@33696 602fd350-edb4-49c9-b593-d223f7449a82
* Toggle visibility of pending bubble when a comment is dynamically moderated
* Add a CSS class to the pending bubble to hide it / remove to show it
See #11200.
git-svn-id: https://develop.svn.wordpress.org/trunk@33692 602fd350-edb4-49c9-b593-d223f7449a82
Similar to `get_hidden_meta_boxes()`, there are now filters named `default_hidden_columns` and `hidden_columns`.
props Compute, MikeHansenMe, chriscct7.
fixes#32499.
git-svn-id: https://develop.svn.wordpress.org/trunk@33689 602fd350-edb4-49c9-b593-d223f7449a82
This fixes the 'The update cannot be installed because we will be unable to copy some files.' error encountered during updates by skipping the write test completely.
Props jobst.
Fixes#33480 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@33688 602fd350-edb4-49c9-b593-d223f7449a82
As noted in the description, returned keys being set is dependent on the existence of those keys in user meta at the point where `_get_additional_user_keys()` is called in `wp_update_user()`.
Fixes#29120.
git-svn-id: https://develop.svn.wordpress.org/trunk@33687 602fd350-edb4-49c9-b593-d223f7449a82
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
As of [32484], `wp_dropdown_categories()` uses the `$value_field` value to
decide whether a given `<option>` should be 'selected'. However, `$value_field`
can refer to a value that is a string, such as a category's slug. This causes
problems when doing a loose comparison (`==`) with the value of the `'selected'`
parameter, which defaults to `0`, because when doing a loose comparison
between an integer and a string, PHP will cast the string to an integer. This
creates false matches, resulting in `<option>` elements getting a 'selected'
attribute incorrectly.
We address the issue by casting the comparison values to strings, and then
using the strict comparison operator `===`.
Fixes#33452 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@33681 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
Also adjusts locale handling to work with Videopress' subtitle implementation.
Props siobhan, jacklenox, sararosso, hugobaeta, nickmomrik, rauchg.
See #32929.
git-svn-id: https://develop.svn.wordpress.org/trunk@33631 602fd350-edb4-49c9-b593-d223f7449a82
If the post cache is not cleared at this point, the cache can become stale
for operations performed before the cache is cleared later in the function.
Specifically, the generation of a `guid` for new posts can use stale data,
resulting in non-unique values. [33262] introduced a call to `get_post()`
that introduced just such an invalidation problem.
Fixes#5305.
git-svn-id: https://develop.svn.wordpress.org/trunk@33630 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
`wp_suspend_cache_invalidation()` was originally added to increase performance,
but the switch to batch processing in [33615] mitigates serious performance
concerns.
As a precaution against timeouts, the batch size has been reduced from 20 to 10.
Props Chouby.
See #30261.
git-svn-id: https://develop.svn.wordpress.org/trunk@33619 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
* Improves some of the feature descriptions.
* Uses .org CDN for images and feature video.
* Fixes an overzealous Jetpack style that adds unwanted padding.
* Uses more specific `WP_List_Table` header.
* Adds 4.3 tagline to freedoms and credit page.
* Adds infrastructure for 4.3 about video. Only the ID needs to be updated.
* Makes all strings translatable.
Props siobhan, adamsilverstein, melchoyce, ocean90, markjaquith, helen, obenland.
Fixes#32929.
git-svn-id: https://develop.svn.wordpress.org/trunk@33613 602fd350-edb4-49c9-b593-d223f7449a82
Also reverts [33157] which is no longer needed.
Props valendesigns, mattwiebe, westonruter, ocean90.
Fixes#33220.
git-svn-id: https://develop.svn.wordpress.org/trunk@33610 602fd350-edb4-49c9-b593-d223f7449a82
* Only call `get_blog_option()` when there is a blog id and we're in Mulitsite. If there is no blog id the request is for the current blog.
* Check return value of `wp_get_attachment_image_src()` before getting the URL since it could be `false`.
* Use `{bool}` rather than `!!` to return a boolean value.
Props MikeHansenMe, obenland.
Fixes#33326.
git-svn-id: https://develop.svn.wordpress.org/trunk@33606 602fd350-edb4-49c9-b593-d223f7449a82
This prevents it from bleeding into other controls, misaligning their buttons.
Selectors use a class now too, which is preferable over ids.
Fixes#33260.
git-svn-id: https://develop.svn.wordpress.org/trunk@33604 602fd350-edb4-49c9-b593-d223f7449a82