Commit Graph

36964 Commits

Author SHA1 Message Date
Andrea Fercia
caf4c06f2a Administration: in WP_List_Table->pagination(), properly concatenate CSS classes for the pagination links when infinite_scroll is set to true.
Props SGr33n.
See #19815.
Fixes #40003.


git-svn-id: https://develop.svn.wordpress.org/trunk@41019 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-09 11:11:03 +00:00
Adam Silverstein
33755709e4 Date/Time: Add unit tests for the human_time_diff function.
Verify that `human_time_diff` works as expected for minute, hour and day intervals. Test that rounding works as expected when the time difference is near the rounding margin.

Props SGr33n.
Fixes #38773.


git-svn-id: https://develop.svn.wordpress.org/trunk@41018 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-07 17:07:40 +00:00
Sergey Biryukov
bb6e34a7fd Media: Use a filename instead of a URL in image header tests to avoid triggering an outbound HTTP request causing an ImageMagick exception on some configurations.
Props danielbachhuber.
Fixes #41216.

git-svn-id: https://develop.svn.wordpress.org/trunk@41017 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-07 00:06:36 +00:00
Sergey Biryukov
50735b09f1 Media: Correct the order of arguments passed to assertions in Tests_Image_Header.
Props danielbachhuber.
See #41216.

git-svn-id: https://develop.svn.wordpress.org/trunk@41016 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 23:57:31 +00:00
Sergey Biryukov
93e7cf5e6f Docs: Update the DocBlock for _WP_Editors::wp_fullscreen_html() after [32677].
See #30949.

git-svn-id: https://develop.svn.wordpress.org/trunk@41015 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 23:43:58 +00:00
Sergey Biryukov
342e4fdf2e Docs: Update the list of static variables in wptexturize() DocBlock after [32863].
Props ajayghaghretiya1.
Fixes #41260.

git-svn-id: https://develop.svn.wordpress.org/trunk@41014 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 21:01:44 +00:00
Drew Jaynes
895cede84a Options: Pass $default as a new parameter to the pre_option_{$option} and pre_site_option_{$option} filters.
This change standardizes some language in the parameter descriptions between the two hook docs in an effort to reduce confusion between the `$pre_option` pseudo-parameters and the new `$default` ones. `$pre_option` is the truthy value used to short-circuit the `get_*option()` call, `$default` is the value passed to the `get_*option()` returned in the event that 1) a short circuit isn't performed, 2) the option doesn't exist.

Props sc0ttkclark.
Fixes #41254.


git-svn-id: https://develop.svn.wordpress.org/trunk@41013 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 15:11:32 +00:00
Weston Ruter
f67018c059 Customize: Prevent edge case fatal error when attempting to save changes to a changeset that had previously been corrupted.
Check return value of `WP_Customize_Manager::get_changeset_post_data()` and return if error instead of assuming it is an array.

Amends [38810].
See #30937.
Fixes #41252.


git-svn-id: https://develop.svn.wordpress.org/trunk@41012 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 07:04:11 +00:00
Ryan McCue
8b5c4ae745 REST API: Fix brittle search test.
This was previously searching for the user ID, which isn't really what it was meant to do. As a result, the test can break if that number appears in any other user information.


git-svn-id: https://develop.svn.wordpress.org/trunk@41011 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 01:34:40 +00:00
Joe McGill
3eb767b5c3 Sanity check $uploaderToggler in wp.media.view.UploaderInline.
This ensures `$uploaderToggler` exists before checking length so any views
extending or scripts accessing this view, won't encounter errors that stop execution.

Props Blackbam, yahil.
Fixes #41231.


git-svn-id: https://develop.svn.wordpress.org/trunk@41009 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-06 00:40:59 +00:00
Sergey Biryukov
a828890ce2 Menus: Make sure current-menu-parent and current-menu-ancestor classes are properly set for parent items of post type archive submenu items.
Props mrwweb, ajoah, welcher.
Fixes #39800.

git-svn-id: https://develop.svn.wordpress.org/trunk@41008 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 21:30:30 +00:00
Sergey Biryukov
4c099bfae9 Docs: Add a @global entry for $tinymce_version in _WP_Editors::default_settings().
Props tejas5989.
Fixes #41244.

git-svn-id: https://develop.svn.wordpress.org/trunk@41007 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-05 18:54:56 +00:00
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