Commit Graph

37102 Commits

Author SHA1 Message Date
James Nylen 0b3663b0a2 Ensure that `wp-api.js` test fixtures do not change with `WP_TESTS_*` constants.
Previously, changing these constants in `wp-tests-config` would cause PHPUnit to regenerate `wp-api-generated.js` with different values.

This commit uses the existing mechanism to also "freeze" all values that would change as a result of changing these constants.

Fixes #41123.


git-svn-id: https://develop.svn.wordpress.org/trunk@41006 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 09:29:58 +00:00
Sergey Biryukov f8efad31f9 Docs: Add a `@global` entry for `$wpdb` in `WP_Network_Query::get_network_ids()`.
Props afzalmultani.
Fixes #41238.

git-svn-id: https://develop.svn.wordpress.org/trunk@41005 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 09:22:14 +00:00
Sergey Biryukov f0955e58e4 Docs: Add a `@global` entry for `$wp_post_statuses` in `WP_Customize_Nav_Menus::make_auto_draft_status_previewable()`.
Props afzalmultani.
See #41238.

git-svn-id: https://develop.svn.wordpress.org/trunk@41004 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 09:20:23 +00:00
Sergey Biryukov b24850d038 Docs: Add a `@global` entry for `$wp` in `redirect_canonical()`.
Props afzalmultani.
See #41238.

git-svn-id: https://develop.svn.wordpress.org/trunk@41003 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 09:18:17 +00:00
Sergey Biryukov d93f4ff3cb Docs: Add a `@global` entry for `$wp_widget_factory` in `WP_Customize_Widgets::get_selective_refreshable_widgets()`.
Props jankimoradiya.
Fixes #41243.

git-svn-id: https://develop.svn.wordpress.org/trunk@41002 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 08:22:54 +00:00
Weston Ruter 8e84510ebb Customize: Fix logic to re-expand a newly inserted nav menu section after placeholder section is replaced.
Fixes todo from Menu Customizer feature plugin: https://github.com/voldemortensen/menu-customizer/commit/0f4ea4e#diff-daa55fade2253f26ccbe02f71058841cR2330
Amends [32806].
Props greuben.
See #32576.
Fixes #40997.


git-svn-id: https://develop.svn.wordpress.org/trunk@41001 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 00:43:11 +00:00
Weston Ruter ebb7793cc6 Widgets: Let Custom HTML widget be "wide" as the Text widget is.
Also update `WP_Customize_Widgets::$core_widget_id_bases` with the new list of core widgets.

Props obenland, westonruter.
See #40907, #40951.


git-svn-id: https://develop.svn.wordpress.org/trunk@41000 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-04 21:00:05 +00:00
Boone Gorges c806540943 Avoid PHP notices when checking termmeta capabilities against a non-existent term.
Previously, checks like `current_user_can( 'edit_term_meta', $term_id )`
returned the proper value, but generated a PHP notice due to the fact
that `get_term( $term_id )` could, in certain instances, return
`WP_Error` objects.

Props caercam.
Fixes #40891.

git-svn-id: https://develop.svn.wordpress.org/trunk@40999 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-04 19:58:35 +00:00
Drew Jaynes 7bc5812ab3 Docs: Add a missing return notation and to the DocBlock for `WP_Session_Tokens::get_instance()`.
Also adds an inline reference to the `session_token_manager` hook in the description.

Props Shelob9 for the initial patch.
Fixes #40102.


git-svn-id: https://develop.svn.wordpress.org/trunk@40998 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-04 17:15:47 +00:00
Sergey Biryukov 944c7c694c General: Always use colon instead of a semicolon in `switch()` control structures.
Props jrf.
Fixes #41234.

git-svn-id: https://develop.svn.wordpress.org/trunk@40997 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-04 09:51:25 +00:00
Andrew Ozz 9b5781fef9 TinyMCE: fix adding the `<!-- more -->` tag when the editor is inline.
Props iseulde.
Fixes #41230.

git-svn-id: https://develop.svn.wordpress.org/trunk@40996 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-03 21:40:22 +00:00
Andrew Ozz 05325257c9 Customizer: improve setting the TinyMCE modals z-index.
Props westonruter, greuben.
See #41158.

git-svn-id: https://develop.svn.wordpress.org/trunk@40995 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-03 21:17:26 +00:00
Boone Gorges a16d16449d Introduce `wp_get_object_terms_args` filter.
This filter allows developers to modify the arguments passed to
`wp_get_object_terms()` before the query is run.

Props enrico.sorcinelli.
Fixes #35925.

git-svn-id: https://develop.svn.wordpress.org/trunk@40994 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-02 18:28:21 +00:00
Peter Wilson 3a4ffa09ab Capabilities: Prevent users having the `do_not_allow` capability.
Meta capabilities use the capability `do_not_allow` to indicate a user should be blocked from performing a particular action. This ensures users can not have the capability as it would cause unexpected behaviour.

Props johnbillion.
Fixes #41059.



git-svn-id: https://develop.svn.wordpress.org/trunk@40993 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-02 05:15:42 +00:00
Sergey Biryukov bf850da3ec Docs: Add a `@global` entry for `$wp_filter` in `wp_start_object_cache()`.
Props bhaveshkhadodara.
Fixes #41222.

git-svn-id: https://develop.svn.wordpress.org/trunk@40992 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 22:13:00 +00:00
Andrew Ozz 02f0ddc844 TinyMCE: respect the `Disable the visual editor when writing` user setting and don't output the TinyMCE components when using `wp_enqueue_editor()`.
Fixes #40960 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40991 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 21:30:10 +00:00
Andrew Ozz 0d9dbc2fea Text widget: bump the TinyMCE modals z-index to 500001 so they show in the Customizer.
Props greuben.
Fixes #41158 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40990 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 20:32:12 +00:00
Drew Jaynes de79ff87b3 Docs: Remove a few more superfluous `@package WordPress` and `@subpackage` notations outside of file headers missed in [40988].
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40989 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 17:10:37 +00:00
Drew Jaynes de87b6d828 Docs: Remove superfluous `@package WordPress` and `@subpackage` notations used outside of file headers in a variety of core files.
Per the inline documentation standards for PHP, there should only be one `@package` and/or `@subpackage` notation per file, and only in the file header.

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40988 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:57:13 +00:00
Drew Jaynes 958d29dc68 Docs: Convert an `@uses` tag in the class DocBlock for `Walker_Nav_Menu_Edit` to `@see`.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40987 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:48:04 +00:00
Drew Jaynes 886e1995c6 Docs: Remove an unnecessary `@package` tag from the DocBlock for `post_preview()`.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40986 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:38:49 +00:00
Drew Jaynes 0a9d2d6b8e Docs: Add a valid return type for `post_preview()` and improve the DocBlock summary.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40985 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 16:36:20 +00:00
boonebgorges 2dff153c75 Introduce `most_used` taxonomy label, for text on 'Most Used' metabox tab.
Props mdifelice, jlambe.
Fixes #41150.

git-svn-id: https://develop.svn.wordpress.org/trunk@40984 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 14:45:02 +00:00
Drew Jaynes 5384177208 General: Ensure `$description` gets initialized in `get_the_archive_description()` if the post type archive conditional is true and the description isn't set.
Props henrywright.
See #38487.


git-svn-id: https://develop.svn.wordpress.org/trunk@40983 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 14:22:59 +00:00
Boone Gorges 6bf8783afd Allow user searches to match the `display_name` field.
Props bcole808, pcarvalho.
Fixes #39643.

git-svn-id: https://develop.svn.wordpress.org/trunk@40982 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 14:21:50 +00:00
Boone Gorges 107c937394 Allow metadata to be updated via `wp_update_comment()`.
Passing an array of `comment_meta` into `wp_update_comment()` will
now update corresponding metadata. Similar functionality already
exists in `wp_insert_comment()`.

Props dshanske, kraftbj.
Fixes #36784.

git-svn-id: https://develop.svn.wordpress.org/trunk@40981 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 13:35:38 +00:00
Boone Gorges b3ed160bd1 Users: Allow data to be filtered before updating or creating a user.
Props DaveFX.
Fixes #40545.

git-svn-id: https://develop.svn.wordpress.org/trunk@40980 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 13:29:09 +00:00
Boone Gorges 1721af83d1 Taxonomy: Ignore cached term value when it doesn't match the queried taxonomy.
When a cache entry is found that matches the requested `$term_id`, but
doesn't match an explicitly provided `$taxonomy`, that cache entry
should be ignored.

Props GunGeekATX.
Fixes #40671.

git-svn-id: https://develop.svn.wordpress.org/trunk@40979 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 11:45:09 +00:00
Boone Gorges a5001396ad Introduce `$comment_count` param for `WP_Query`.
This parameter allows querying for posts with a specific value of
`comment_count`. It is also possible to query for posts that match
a `comment_count` comparison by passing an array with 'value' and
'compare' operators (eg `array( 'compare' => '>', 'value' => 5 )`).

Props ramon fincken.
Fixes #28399.

git-svn-id: https://develop.svn.wordpress.org/trunk@40978 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 11:24:26 +00:00
Drew Jaynes 2744e29fd3 Remove an unnecessary initialization of `$description` due to the else condition in `get_the_archive_description()`.
See [40976]. See #38487.


git-svn-id: https://develop.svn.wordpress.org/trunk@40977 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 05:18:57 +00:00
Drew Jaynes 336d718bfc General: Add support for the post type archive description to `get_the_archive_description()`, and thereby also `the_archive_description()`.
Props henrywright.
Fixes #38487.


git-svn-id: https://develop.svn.wordpress.org/trunk@40976 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 05:14:18 +00:00
Drew Jaynes 0b5b1a667f Link Template: Clarify documentation for the `$id` parameter in `get_post_permalink()`, `get_edit_post_link()`, `edit_post_link()`, and `get_delete_post_link()`, to reflect that either a post ID or `WP_Post` object is accepted.
Separately, use `$post` for checking the post status and retrieving the page_uri in `get_post_permalink()` instead of referencing back to the original `$id` parameter.

Props GunGeekATX for the initial patch.
Fixes #40780.


git-svn-id: https://develop.svn.wordpress.org/trunk@40975 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 03:28:11 +00:00
Drew Jaynes 417b094dd4 Users: Introduce the `manage_users_extra_tablenav` action, fired immediately outside the closing "actions" div in the Users list table tablenav.
A similar `manage_posts_extra_tablenav` hook fires in the same location and context in the Posts list table tablenav.

Props GunGeekATX, adamsilverstein.
Fixes #36990.


git-svn-id: https://develop.svn.wordpress.org/trunk@40974 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-01 03:01:16 +00:00
Drew Jaynes a14ea35c38 Docs: Add a `@property-read` notation for the read-only `WP_Term::$data` property.
See [35269], #34348 and #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40973 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 17:03:24 +00:00
Drew Jaynes d9ae7f920d Docs: Add missing `@since`, `@access`, and `@global` notations to the DocBlock for `WP_Query::parse_search_order()`.
Props dixitadusara.
Fixes #41045.


git-svn-id: https://develop.svn.wordpress.org/trunk@40972 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 16:07:05 +00:00
Drew Jaynes 3ebd6bfda0 Docs: Add full parameter and return documentation for `WP_Text_Diff_Renderer_Table::interleave_changed_lines()`.
Props coffee2code.
Fixes #38520.


git-svn-id: https://develop.svn.wordpress.org/trunk@40971 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 05:28:20 +00:00
Drew Jaynes 30b915922a Docs: Use third-person singular verbs in the summaries for `wp_unschedule_hook()` and `wp_clear_scheduled_hook()`.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40970 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 04:53:53 +00:00
Drew Jaynes 8d783f1275 Docs: Clarify accepted types and values for `$menu` parameters in several contexts:
* `wp_nav_menu()`
* `wp_get_nav_menu_object()` and its filter `wp_get_nav_menu_object`
* `is_nav_menu()`
* `wp_delete_nav_menu()`
* `wp_get_nav_menu_items()`

Props dimadin.
Fixes #38166.


git-svn-id: https://develop.svn.wordpress.org/trunk@40969 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 04:48:20 +00:00
Drew Jaynes 626f78750b Tests: Add `@method` notations to factor class DocBlocks as a way to indicate expected return types from factory methods for the benefit of IDEs.
Props jdgrimes.
Fixes #37867.


git-svn-id: https://develop.svn.wordpress.org/trunk@40968 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 04:35:39 +00:00
Drew Jaynes 63739c5c3d Docs: Provide best practice guidance for achieving parity between `$menu_slug` values supplied when adding menu and submenu pages, and later trying to compare those initial values against sanitized screen IDs derived from `$menu_slug`.
At the heart of the matter, the `$menu_slug` parameter in `add_menu_page()` and `add_submenu_page()` is not sanitized with `sanitize_key()`. When the screen object is later built for the admin page, the screen ID is derived from that `$menu_slug` value, though passed through `sanitize_key()`, which can produce unexpected results in comparison check.

Changing the sanitization code to provide actual parity is out of the question at this juncture, so updating the docs to describe how to avoid this edge case is the next best option.

Props GregRoss.
Fixes #35305.


git-svn-id: https://develop.svn.wordpress.org/trunk@40967 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 04:17:56 +00:00
Drew Jaynes e087254993 Docs: Add more useful summaries to the DocBlocks for boolean `$is_*` properties in `WP_Query`.
Props megane9988 for the initial patch.
Fixes #34726.


git-svn-id: https://develop.svn.wordpress.org/trunk@40966 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 03:43:41 +00:00
Sergey Biryukov 21a6c7b050 Cron API: Introduce `wp_unschedule_hook()` to clear all events attached to a hook.
This complements `wp_clear_scheduled_hook()`, which only clears events attached with specific arguments.

Props arena, mordauk, jrf.
Fixes #18997.

git-svn-id: https://develop.svn.wordpress.org/trunk@40965 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-30 00:21:49 +00:00
Drew Jaynes a970c07994 Docs: Don't reference non-existent hooks inline in the DocBlock descriptions for the following template functions:
* `get_index_template()`
* `get_404_template()`
* `get_author_template()`
* `get_category_template()`
* `get_tag_template()`
* `get_taxonomy_template()`
* `get_date_template()`
* `get_home_template()`
* `get_front_page_template()`
* `get_page_template()`
* `get_search_template()`
* `get_single_template()`
* `get_embed_template()`
* `get_singular_template()`
* `get_attachment_template()`

As mentioned when these dynamic hook references were originally fixed in [33274], we can't link to non-existent hooks inline because the Code Reference auto-linker won't pick up on the dynamic-ness of the hook, it'll just try to link to a hook reference that doesn't exist. In these cases, we need to be generic and provide context for the value of `$type`.

See [38418] for where the original fix was reversed. See this changeset for reversing the reversal.

Props donutz, milana_cap.

Fixes #41198.


git-svn-id: https://develop.svn.wordpress.org/trunk@40964 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 16:04:45 +00:00
Drew Jaynes 2d68e15e00 Docs: Don't reference non-existent hooks inline in the DocBlock description for `get_archive_template()`.
Also removes extra curly braces from the dynamic hook references added in [40962] to aid future re-parsing.

See #41198.


git-svn-id: https://develop.svn.wordpress.org/trunk@40963 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 15:46:29 +00:00
Drew Jaynes de8cb2d5b2 Docs: Don't reference non-existent hooks inline in the DocBlock description for `get_post_type_archive_template()`.
Props milana_cap.
See #41198.


git-svn-id: https://develop.svn.wordpress.org/trunk@40962 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 15:38:14 +00:00
James Nylen 5c4f490ea8 REST API: Add a filter to allow modifying the response *after* embedded data is added.
Fixes #38964.


git-svn-id: https://develop.svn.wordpress.org/trunk@40961 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 13:16:19 +00:00
Sergey Biryukov 33f8a894cf Administration: In `WP_List_Table::comments_bubble()`, replace the mdash with its HTML entity for consistency with the similar code in other list tables.
Props afercia.
See #40659, #32152.

git-svn-id: https://develop.svn.wordpress.org/trunk@40960 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-29 00:03:02 +00:00
Sergey Biryukov 44d162d0b2 Docs: Add a `@global` entry for `$post` variable in `wp_post_preview_js()`.
Props avinapatel.
Fixes #41194.

git-svn-id: https://develop.svn.wordpress.org/trunk@40959 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-28 12:54:31 +00:00
Sergey Biryukov 021d5ba403 Docs: Add missing backtick character in `export_wp()` DocBlock.
Props pbiron.
Fixes #41178.

git-svn-id: https://develop.svn.wordpress.org/trunk@40958 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-27 00:57:56 +00:00
Sergey Biryukov 6fa3e5c883 Administration: In taxonomy list tables, display a dash instead of a blank space and add "No description" as a screen reader text when the term description is blank.
Props pratikgandhi, yahil.
Fixes #40659.

git-svn-id: https://develop.svn.wordpress.org/trunk@40957 602fd350-edb4-49c9-b593-d223f7449a82
2017-06-27 00:33:31 +00:00