Commit Graph

30131 Commits

Author SHA1 Message Date
Boone Gorges a59ebc0ed4 Term unit test factory class should override `create_and_get()` method.
The override is necessary because the `get_term()` call, which fetches the
term object, needs the `'taxonomy'` argument passed to the factory method.

Props dlh.
Fixes #32536.

git-svn-id: https://develop.svn.wordpress.org/trunk@32659 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-30 13:03:07 +00:00
Weston Ruter cc19680774 Add JS templates for Customizer Panels and Sections.
This extends the approach taken for Customizer Controls in #29572.

Props celloexpressions, westonruter, ocean90.
See #30737.


git-svn-id: https://develop.svn.wordpress.org/trunk@32658 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-30 00:02:13 +00:00
Scott Taylor ef6315a7a2 After [32656], add `@access` annotations to methods that have no doc block in `wp-includes/*`.
Makes it easier to search for no doc blocks via `}[\n\t\r ]+(protected|private|public)`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32657 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 21:36:38 +00:00
Scott Taylor c49c139a22 Add `@access` annotations to methods that have no doc block in `wp-admin/includes/*`.
Makes it easier to search for no doc blocks via `}[\n\t\r ]+(protected|private|public)`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32656 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 21:31:56 +00:00
Scott Taylor 60e5c90e62 Add (more) missing doc blocks to `wp-admin/includes/*`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32655 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 21:16:59 +00:00
Scott Taylor ec5758225c Add missing doc blocks to `wp-admin/includes/*`.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32654 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 20:16:22 +00:00
Scott Taylor d55800a4f2 In the style of #30947 and `default-filters.php`, add 2 new files to `wp-admin/includes`:
`admin-filters.php`
`ms-admin-filters.php`

There are random actions and filters littered among files like `misc.php`. These files contain functions that won't work outside of admin context and are typically only loaded in files that have already loaded the admin bootstrap.

See #32529.


git-svn-id: https://develop.svn.wordpress.org/trunk@32653 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 17:03:13 +00:00
Scott Taylor d5e9f8770a Add missing` annotations to `ajax-actions.php`
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32652 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 16:00:29 +00:00
Helen Hou-Sandi 923bffda98 Define a primary column for `WP_Post_Comments_List_Table`.
props boonebgorges.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32651 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 15:51:11 +00:00
Scott Taylor c8a44d437a Add `@static*` annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32650 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 15:42:40 +00:00
Dominik Schilling (ocean90) cced199188 Customizer: Replace accordion behavior of sections with a slide-in navigation.
This allows users to focus on the contents of the active section more easily and separating the navigation from the content/controls in the Customizer.

props valendesigns, celloexpressions.
see #31336.

git-svn-id: https://develop.svn.wordpress.org/trunk@32649 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 13:56:39 +00:00
Boone Gorges bb8999fb0e When parsing what appears to be a date archive request, check for a post with a clashing permalink before resolving to the archive.
A URL like `example.com/2015/05/15/` generally resolves to the May 15, 2015 date
archive. But in certain cases, it could also be the permalink of a post with
the slug `'2015'`. When a conflict of this sort is detected, resolve to the post
instead of the archive.

URL conflicts of this sort should no longer occur for new posts; see [32647].

Props valendesigns, boonebgorges, Denis-de-Bernardy.
Fixes #5305.

git-svn-id: https://develop.svn.wordpress.org/trunk@32648 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 13:09:26 +00:00
Boone Gorges 683ae35c33 Disallow post slugs that will result in permalinks that conflict with date archive URLs.
On certain permalink structures, a numeric post slug will result in a post
permalink that conflicts with a date archive URL. For example, with permastruct
`/%year%/%monthnum%/%postname%/`, a post published in May 2015 with slug
`'15'` will result in a URL (`/2015/05/15/`) that conflicts with the archive
for May 15, 2015.

To avoid this problem, `wp_unique_post_slug()` rejects a requested slug when it
would generate a conflict of this type. Thus, in our example, `'15'` would
become `'15-2'`.

Props valendesigns, boonebgorges, Denis-de-Bernardy, loushou.
See #5305.

git-svn-id: https://develop.svn.wordpress.org/trunk@32647 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 12:52:17 +00:00
Boone Gorges 25afc4b16a `is_email_address_unsafe()` tests should only be run on multisite.
See [32638].

git-svn-id: https://develop.svn.wordpress.org/trunk@32646 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 12:37:51 +00:00
Helen Hou-Sandi ea9de1aacd After [32644], sanity for a pile of selectors.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32645 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 02:59:44 +00:00
Helen Hou-Sandi 86c907d2a5 List tables: introduce the concept of a "primary" column.
This becomes the column that contains the row actions, and allows for a more flexibility, particularly with custom post types and list tables. To (re)define the primary column, use the `list_table_primary_column` filter, which receives the column name and the screen ID as arguments.

props stephdau, DaveAl, jesin.
see #25408.


git-svn-id: https://develop.svn.wordpress.org/trunk@32644 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 02:40:52 +00:00
Scott Taylor f864c1d712 Add `@global` annotations to (the rest of the?) `wp-admin/*` files.
Does not include list table file changes.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32643 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-29 02:05:26 +00:00
Scott Taylor 23ce2efd12 Add `@global` annotations for `wp-admin/*`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32642 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 21:40:27 +00:00
Scott Taylor 5f8df2290f Add missing/alter existing doc blocks for `wp-db.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32641 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 20:09:54 +00:00
Scott Taylor 5e20854d3d Alter visibility of some properties in `wpdb`:
`num_queries` is accessed publicly in core.
`num_rows` is accessed publicly in `ms-settings.php`.
`insert_id` is accessed publicly in core.
`prefix` is accessed publicly in `upgrade.php` and `capabilities.php`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32640 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 16:33:31 +00:00
Scott Taylor 5c568b5c31 Add missing doc blocks to `widgets.php`.
Cleanup `@return` values.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32639 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 16:19:51 +00:00
Boone Gorges 8dced310b1 Improve tests for `is_email_address_unsafe()`.
* Move to a separate file for better organization and method names.
* Use a `dataProvider` when appropriate, for better readability.
* Add a test for splitting the banned domain list on line breaks.

See #20459, #21730.

git-svn-id: https://develop.svn.wordpress.org/trunk@32638 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 16:05:30 +00:00
Scott Taylor 7d532968eb Add missing doc blocks to `user.php`.
`username_exists()` should return `false` instead of `null`, just like `email_exists()` does, which is right under it.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32637 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 15:50:34 +00:00
Helen Hou-Sandi 805d876017 About: Give bottom navigation links the full width.
This will prevent longer strings from wrapping needlessly, and is more semantically correct markup.

props tyxla.
fixes #32391.


git-svn-id: https://develop.svn.wordpress.org/trunk@32636 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 15:38:44 +00:00
Scott Taylor 5b85526344 Add missing doc blocks to `update.php`:
* `wp_version_check()`, `wp_update_plugins()`, and `wp_update_themes()` do not return meaningful responses, and their responses are never handled by core. As such, they shouldn't alternately return `void` or `false`. "Returning" in those functions is just "bailing"
* In the same functions, `version.php` doesn't need to load if `WP_INSTALLING` is defined - the function will immediately bail, the values will never be read, and the globals won't be reset. I have unified the approach in all 3 functions.
* When returning filtered `$locale`, there is no need to set the variable twice.
* In `_maybe_update_core()`, `isset()` can take multiple values to bail before the call to `time()`, if necessary. This is a micro-optimization to prevent PHP from hitting the OS unnecessarily.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32635 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 15:28:10 +00:00
Jeremy Felt c12e7d763c Use a dataProvider for network option sanitization tests.
Cleans up tests for sanitization of `illegal_names`, `illegal_email_domains`, and `banned_email_domains` network options.

Fixes #32517.


git-svn-id: https://develop.svn.wordpress.org/trunk@32634 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 06:37:44 +00:00
Andrew Nacin abd407a9ea Revert change to default-filters.php in [32632]. see #32516.
git-svn-id: https://develop.svn.wordpress.org/trunk@32633 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 05:51:30 +00:00
Andrew Nacin e0cfefaa5e Fix `return` error in get_theme_mods() from [32629].
Split a line with both an assignment and a conditional, not to mention an interpolated variable. Lots going on, easy mistake to make.

props BrianLayman.
fixes #32516.


git-svn-id: https://develop.svn.wordpress.org/trunk@32632 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 05:50:40 +00:00
Andrew Nacin 7aef782aa8 Add unit test asserting that serializable objects will never pass is_serialized(). see #17375.
git-svn-id: https://develop.svn.wordpress.org/trunk@32631 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-28 05:22:14 +00:00
Jeremy Felt b1e80f0388 Use site objects rather than get_blog_status() in MS list tables.
Removes several repetitive calls to `get_blog_status()` that are not needed, as the data is already available as part of each site's object.

Fixes #32512.


git-svn-id: https://develop.svn.wordpress.org/trunk@32630 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 23:13:04 +00:00
Scott Taylor 266a7f2f9d Add missing doc blocks to `theme.php`.
Correct some `@return` values.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32629 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 22:20:48 +00:00
Scott Taylor c8ec7ffffa Add missing doc blocks to `template.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32628 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 22:03:52 +00:00
Scott Taylor be0175838b Add missing doc blocks to `taxonomy.php`.
Correct some `@return` values.
Some functions can `return new WP_Error` without setting it to a variable.
Some functions can return their `apply_filters(...)` call without first setting it to a variable.
`is_object_in_taxonomy()` can return its conditional instead of if/else true/false.
 
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32627 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 21:59:06 +00:00
Jeremy Felt 9560fbdd77 Provide all site flag data in objects returned by `get_blogs_of_user()`
Previously, `archived`, `spam`, and `deleted` properties were forced to `0` when returned by `get_blogs_of_user()`. This was originally introduced in [21794] as a way to prevent notices when properties were expected.

Instead, we can properly fill these properties with those retrieved from `get_blog_details()`.

Props realloc.
Fixes #32281.


git-svn-id: https://develop.svn.wordpress.org/trunk@32626 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 21:22:09 +00:00
Mark Jaquith 556ffa235a Insert temporary password field hook for feature development in a plugin.
git-svn-id: https://develop.svn.wordpress.org/trunk@32625 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 19:58:38 +00:00
Scott Taylor a3f2743f9a Add missing doc blocks to `shortcodes.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32624 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 19:39:00 +00:00
Scott Taylor 4eb73b6683 Add missing doc blocks to `script-loader.php`.
Use `wp_styles()` and `wp_scripts()` where appropriate. 
 
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32623 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 19:33:41 +00:00
Scott Taylor 2f822e758c Add missing doc blocks to `rewrite.php`.
Clarify `@return` values where necessary.
`add_permastruct()` doesn't need to return.
`->using_index_permalinks()` and `->using_mod_rewrite_permalinks()` can just return their conditions, instead of if/else true/false.
`->mod_rewrite_rules()` and `->iis7_url_rewrite_rules()` don't need to set a variable that is immediately returned.
 
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32622 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 19:22:59 +00:00
Scott Taylor 496b36db35 Add missing doc blocks to `revision.php`.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@32621 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 18:37:29 +00:00
Scott Taylor d1675e2571 Add missing doc blocks to `query.php`.
Clarify `@return` values where necessary.
Some wrapper functions don't need to return if the function they wrap doesn't return.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32620 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 18:14:08 +00:00
Scott Taylor e4480ea91e Add missing doc blocks to `post.php`.
Clarify some existing values for `@param` and `@return`.
Some functions do not need to set a variable before immediately returning it.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32619 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 17:04:45 +00:00
Scott Taylor 5e44938537 Add missing doc blocks to `post-thumbnail-template.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32618 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 16:28:37 +00:00
Scott Taylor a3f9ed1494 Add missing doc blocks to `post-template.php`.
Correct some types for `@param` and `@return`.
`is_page_template()` can return the conditional instead of if/else true/false.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32617 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 16:25:17 +00:00
Scott Taylor 0c2421bff2 Add missing doc blocks to `post-formats.php`.
Correct some types for `@param` and `@return`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32616 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 16:05:33 +00:00
Scott Taylor a35e24fba5 Add missing doc blocks to `plugin.php`.
`has_filter()` can use strict comparison when checking `$has` internally.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32615 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 15:55:35 +00:00
Scott Taylor 932af17935 Add missing doc blocks for `pluggable.php`.
Correct some `@return` values.
`is_user_logged_in()` can simply return the `->exists()` call instead of if/else'ing true/false.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32614 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-27 15:31:46 +00:00
Scott Taylor 9a5af9d3d2 Fix doc blocks for `option.php`.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32613 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-26 22:16:15 +00:00
Scott Taylor a418d57c5a Fix doc blocks for `nav-menu*.php` files.
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32612 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-26 22:09:26 +00:00
Scott Taylor 85e3befce9 Fix doc blocks for `ms-*.php` files.
A few functions can return a conditional instead of an `if`/`else` of `true`/`false`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32611 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-26 21:50:13 +00:00
Scott Taylor 58f8af684d Fix doc blocks for `meta.php`
See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32610 602fd350-edb4-49c9-b593-d223f7449a82
2015-05-26 19:32:55 +00:00