Commit Graph

1067 Commits

Author SHA1 Message Date
Scott Taylor ad163d3547 In `get_page_uri()`, do not add parent slugs to orphaned pages.
Adds unit test.

Props filosofo, MikeHansenMe, MikeHansenMe, chriscct7.
Fixes #15963. 


git-svn-id: https://develop.svn.wordpress.org/trunk@34001 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 16:53:52 +00:00
Jeremy Felt ef1f697564 Multisite: Allow users with `manage_network_users` to edit network users.
Other users in a network can now be given capabilities to manage users without also having global super admin privileges.

* Users with `manage_network_users` can not edit super admins.
* Users with `manage_network_users` can not promote users to super admin.
* Uses of `is_super_admin()` in `user-new.php` are now updated to `manage_network_users`.

Props daniellandau, chriscct7.
Fixes #16860.


git-svn-id: https://develop.svn.wordpress.org/trunk@33988 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 03:33:22 +00:00
Jeremy Felt c89822ebe0 Multisite: Test `edit_user` capabilities for multisite administrators
An administrator in multisite can not edit users other than itself.

Props daniellandau for the initial patch.
See #16860.


git-svn-id: https://develop.svn.wordpress.org/trunk@33987 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 03:20:11 +00:00
Scott Taylor 6bc498c0e6 Implement a priority system for Help Tabs to add them at specific positions.
Adds unit tests.

Props swissspidy.
Fixes #19828.


git-svn-id: https://develop.svn.wordpress.org/trunk@33985 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-10 01:26:26 +00:00
Andrew Ozz cc18f258cb TinyMCE: update to 4.2.5, changelog: http://www.tinymce.com/develop/changelog/?ctrl=version&act=index&pr_id=1.
Fixes #33782 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@33981 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 19:44:09 +00:00
Scott Taylor 9eefbd1999 Deprecate `wp_get_http()` - function isn't used anywhere (apart from itself).
Props swissspidy.
Fixes #33709.


git-svn-id: https://develop.svn.wordpress.org/trunk@33969 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-09 04:25:24 +00:00
Andrew Ozz bb6dee64ae Formatting: maintain the content of HTML comments when they contain `<object>` tags. Add more tests for wpaitop().
Props miqrogroove.
Fixes #33645 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@33955 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-08 22:54:08 +00:00
Scott Taylor 6d0c15836b After [33840], JS regex needs the `g` modifier.
Add another unit test case.

Props kitchin.
Fixes #22781.


git-svn-id: https://develop.svn.wordpress.org/trunk@33947 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-08 16:43:27 +00:00
Gary Pendergast f921391922 Tests: Check that `readme.html` is recommending an actively supported version of MySQL.
Per the MySQL support guidelines (https://www.mysql.com/support/), Oracle provides active support for MySQL releases for 5 years from the General Availality release.

See #33758.



git-svn-id: https://develop.svn.wordpress.org/trunk@33946 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-08 03:23:29 +00:00
Gary Pendergast 65156c6fc5 Tests: Add an extra warning message when checking the recommended PHP version.
See #33758.



git-svn-id: https://develop.svn.wordpress.org/trunk@33944 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-07 07:27:34 +00:00
Gary Pendergast 0b6454bac5 Readme: Update the recommended PHP version to 5.6.
This also includes a unit test to ensure we're only recommending actively supported versions of PHP in the future.

Fixes #33758.



git-svn-id: https://develop.svn.wordpress.org/trunk@33937 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-07 05:22:03 +00:00
Scott Taylor 2d68434dff After [33925], rename the unit test class to `Tests_Comment_Meta_Cache` to avoid collisions on the PHP 5.2 superhighway.
See #16894.


git-svn-id: https://develop.svn.wordpress.org/trunk@33926 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 22:29:59 +00:00
Scott Taylor 542ac152fc In `wp_list_comments()`, update the comment meta cache when the comments derive from `WP_Query` and the new `->comment_meta_cached` prop is `false`.
There are no uses of `wp_list_comments()` in Core where `$comments` are passed as the 2nd argument.

Adds unit tests.

Props wonderboymusic, bradt.
Fixes #16894.


git-svn-id: https://develop.svn.wordpress.org/trunk@33925 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 22:24:16 +00:00
John Blackbourn dd9722fac0 Bail out early from `esc_url()` if the URL becomes empty after stripping out disallowed characters.
Fixes #28015
Props jesin for the unit test


git-svn-id: https://develop.svn.wordpress.org/trunk@33923 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 21:28:50 +00:00
Scott Taylor 26dd8b5b08 Allow `wp_insert_post()` to accept a `meta_input` argument. Devs should use `register_meta()` to ensure that specific values specified by key are sanitized properly.
Adds unit test.

Props CoenJacobs, swissspidy.
Fixes #20451.


git-svn-id: https://develop.svn.wordpress.org/trunk@33910 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 19:49:53 +00:00
Sergey Biryukov dde7dc7145 Update `Tests_Sanitize_Option::test_sanitize_option()` after [33858].
See #23605.

git-svn-id: https://develop.svn.wordpress.org/trunk@33907 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 14:17:24 +00:00
Sergey Biryukov b0d3f5922e Update `Tests_Admin_includesPlugin::test_menu_page_url()` after [33858].
See #23605.

git-svn-id: https://develop.svn.wordpress.org/trunk@33906 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 14:15:51 +00:00
Sergey Biryukov b09823a1d3 Update `Tests_Formatting_GetUrlInContent::get_input_output()` after [33858].
Props gitlost.
Fixes #23605.

git-svn-id: https://develop.svn.wordpress.org/trunk@33905 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-05 14:05:05 +00:00
Boone Gorges 9dfc5551ee In `get_terms()`, allow terms to be ordered by 'term_id'.
[29128] introduced updated documentation for the `'orderby'` parameter of
`get_terms()`. The new documentation mistakenly said that 'term_id' was a valid
orderby value. The current changeset makes that fantasy...A REALITY.

Props ixkaito.
Fixes #33726.

git-svn-id: https://develop.svn.wordpress.org/trunk@33903 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-04 21:16:11 +00:00
John Blackbourn 65c7f9113d Correctly encode spaces in URLs passed to `esc_url()` instead of removing them.
Fixes #23605
Props enshrined, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@33858 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-02 17:19:29 +00:00
John Blackbourn f34a386916 More unit tests for `esc_url()` and `esc_url_raw()`.
See #23605, #20771, #16859


git-svn-id: https://develop.svn.wordpress.org/trunk@33855 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-02 16:50:02 +00:00
John Blackbourn 4720c6e482 Add some more passing unit tests for `esc_url()` in preparation for upcoming changes.
See #23605, #20771, #16859


git-svn-id: https://develop.svn.wordpress.org/trunk@33851 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-02 14:19:21 +00:00
Boone Gorges 7232be7dcd Remove `#` from `@ticket` annotation in a unit test.
This improper character was erroneously introduced in [33724].

Props netweb.
Fixes #33532.

git-svn-id: https://develop.svn.wordpress.org/trunk@33850 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-02 13:39:05 +00:00
Scott Taylor 42dcb586ee After [33807], fix unit tests for PHP 5.2
Fixes #17626.


git-svn-id: https://develop.svn.wordpress.org/trunk@33846 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-01 17:03:13 +00:00
Scott Taylor 99c34d57c1 User Settings: allow dashes in `get|set_user_setting()` in PHP and `get|setUserSetting()` in JS.
Add unit tests - there were none. Mock `set_user_setting()` since it won't run due to `headers_sent()` being `true`.

Fixes #22781.


git-svn-id: https://develop.svn.wordpress.org/trunk@33840 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-01 03:56:44 +00:00
Scott Taylor 48ae1fcc1d After [33822], really add those unit tests for `wp_count_comments()`.
See #19903. 


git-svn-id: https://develop.svn.wordpress.org/trunk@33823 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-31 18:51:00 +00:00
Scott Taylor 3028a096be Comments: `wp_count_comments()` can use `get_comment_count()` internally to makes its DB query, provided that `get_comment_count()` returns more properties.
Adds/updates unit tests. There were zero (0) unit tests for `wp_count_comments()`.

Fixes #19903. 


git-svn-id: https://develop.svn.wordpress.org/trunk@33822 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-31 18:50:12 +00:00
Konstantin Obenland 903b9af181 Themes: Get the correct theme when template and stylesheet were both passed as arguments.
Fixes a bug where `$new_theme` got set before the second argument was
appropriately handled, causing the `current_theme` option to later always be
updated to the parent theme's name.

Introduced in [21131].

Props obenland, wonderboymusic.
Fixes #32635.



git-svn-id: https://develop.svn.wordpress.org/trunk@33815 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-30 21:44:38 +00:00
Scott Taylor bddf7c76ec Add some theme mod unit tests.
Props MikeHansenMe.
See #28637.


git-svn-id: https://develop.svn.wordpress.org/trunk@33812 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-30 03:42:49 +00:00
Scott Taylor c4b8ad087f Improve the reliability of the crop returned by `image_get_intermediate_size()`.
Add a bunch of unit tests to `tests/image/intermediate_size.php`.

Props joemcgill, ericlewis, kitchin, SergeyBiryukov, chipbennett.
Fixes #17626.


git-svn-id: https://develop.svn.wordpress.org/trunk@33807 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-30 02:40:40 +00:00
Scott Taylor da0a823129 `get_comment_count()` currently increments `awaiting_moderation` when comments are in the trash. This occurs because `case 0:` will match any value passed to `switch` that is a string that isn't specified in the list of cases. This is terrifying.
* Cases for `0` and `1` should be `'1'` and `'0'`
* Add unit tests for `get_comment_count()`. Currently, there are none.

See #33414.


git-svn-id: https://develop.svn.wordpress.org/trunk@33806 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-30 02:18:18 +00:00
Boone Gorges 27c8977af9 In `wp_list_categories()`, 'current_category' should accept an array of values.
This allows the 'current-cat' or 'current-cat-parent' classes to be applied
to more than one item in the list.

Props vilkatis.
Fixes #33565.

git-svn-id: https://develop.svn.wordpress.org/trunk@33804 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-29 19:45:35 +00:00
Sergey Biryukov 28767e1bac In `get_post_type_labels()`, ensure that filtered labels contain all required default values.
fixes #33543.

git-svn-id: https://develop.svn.wordpress.org/trunk@33776 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-28 03:38:26 +00:00
John Blackbourn d89398f945 Don't change the View Post button permalink in the sample permalink HTML when updating the slug on a published or future post.
Fixes #32954
Props boonebgorges, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@33773 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-27 20:56:54 +00:00
John Blackbourn f312173db5 Improve the efficiency of `is_user_member_of_blog()` by removing its use of `get_blogs_of_user()`. Adds additional tests.
Fixes #32472
Props BinaryKitten, sammybeats, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@33771 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-27 20:01:37 +00:00
Boone Gorges 718787cd18 Rename param added to `wp_list_categories()` in [33764] to 'hide_title_if_empty'.
Props vilkatis, DrewAPicture.
Fixes #33565.

git-svn-id: https://develop.svn.wordpress.org/trunk@33767 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-27 02:08:31 +00:00
Boone Gorges a684d5d19d Introduce `hide_title_if_no_cats` parameter to `wp_list_categories()`.
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
2015-08-26 19:41:55 +00:00
Sergey Biryukov b935049f24 Add `'wp_verify_nonce_failed'` action that fires when nonce verification fails.
props johnbillion, garza, Shelob9.
fixes #24030.

git-svn-id: https://develop.svn.wordpress.org/trunk@33744 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 00:05:11 +00:00
Scott Taylor a0a351a75d Add some more data for Shortcode unit tests.
Props miqrogroove.
Fixes #33455.


git-svn-id: https://develop.svn.wordpress.org/trunk@33740 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-25 21:50:55 +00:00
Boone Gorges 32cd95e1c1 In `WP_Query::parse_tax_query()`, allow 'cat' and 'tag' querystrings to be formatted as arrays.
See [33095] #32454 for a previous fix related to custom taxonomies.

Props Veraxus.
Fixes #33532.

git-svn-id: https://develop.svn.wordpress.org/trunk@33724 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 21:21:49 +00:00
Gary Pendergast bf3d36e0b6 WPDB: `get_table_from_query()` didn't find table names with hyphens in them.
Props dustinbolton for the fix.

Fixes #33470.



git-svn-id: https://develop.svn.wordpress.org/trunk@33718 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-24 00:18:49 +00:00
Boone Gorges b01b3be23e In `wp_delete_term()`, the `$deleted_term` object passed to filters should be generated before term relationships are deleted.
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
2015-08-22 19:42:30 +00:00
Scott Taylor 36a9be2af5 In `wp_sanitize_redirect()`, don't eat `@` characters. According to RFC 3986, "@" is a perfectly valid character in a URL path or query string.
Adds unit test.

Props markjaquith.
Fixes #18818.


git-svn-id: https://develop.svn.wordpress.org/trunk@33707 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 17:04:17 +00:00
Scott Taylor dc48f3d795 Query:
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
2015-08-22 16:58:21 +00:00
Scott Taylor a70e0183e5 Ensure that `attachment_url_to_postid()` matches cross-scheme when front-end and back-end schemes are different.
Adds unit test.

Props welcher.
Fixes #33109.


git-svn-id: https://develop.svn.wordpress.org/trunk@33705 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 16:38:09 +00:00
Dominik Schilling (ocean90) 918dd71257 Tests: Fix a typo in function names for `$autoload` tests.
Autoload is "no" if the `$autoload` param for `update_option()` is `'no'` or `false`.

see #26394.

git-svn-id: https://develop.svn.wordpress.org/trunk@33703 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-22 09:44:48 +00:00
Dominik Schilling (ocean90) cb4a9ea174 Tests: Skip some tests for the Transients API when an external object cache is in use.
`test_transient_data_with_timeout()`, `test_transient_add_timeout()`, `test_nonexistent_key_dont_delete_if_false()`, and `test_nonexistent_key_old_timeout` are testing option values which aren't available with an an external object cache like memcache.

see #31491.

git-svn-id: https://develop.svn.wordpress.org/trunk@33702 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-21 20:32:42 +00:00
Boone Gorges c1b8f1f72a In `Walker_CategoryDropdown::start_el()`, cast values to strings before deciding whether to append 'selected' attribute.
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
2015-08-21 01:10:34 +00:00
Boone Gorges 5e9a216cf7 Introduce `post_name__in` parameter for `WP_Query`.
Props enshrined.
Fixes #33065.

git-svn-id: https://develop.svn.wordpress.org/trunk@33653 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-20 02:18:05 +00:00
Boone Gorges 9bb010f2a1 `wp_update_term()` should return a true integer for 'term_taxonomy_id'.
Props ipm-frommen.
Fixes #32876.

git-svn-id: https://develop.svn.wordpress.org/trunk@33652 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-19 19:32:04 +00:00