Commit Graph

28148 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90)
4175d8a922 Customizer: Add support for the media library in Background Image controls.
`WP_Customize_Upload_Control` (PHP) and `api.UploadControl` (JS) can now open the media modal.

props celloexpressions, and ericlewis for docs.
see #21483.

git-svn-id: https://develop.svn.wordpress.org/trunk@30309 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 23:51:48 +00:00
Dominik Schilling (ocean90)
3566ac62c8 Customizer: Trigger widget-added event when initializing.
Widget controls are now added to the pane dynamically via JavaScript, see #28709.
Remove the event trigger from `SidebarControl.addWidget()` as it's covered by `WidgetControl.ready()`.

props westonruter.
fixes #30236.

git-svn-id: https://develop.svn.wordpress.org/trunk@30308 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 22:45:47 +00:00
Dominik Schilling (ocean90)
3b3be684e8 Customizer: Use jQuery.fn.toggle() instead of slideUp/slideDown if panel/section/control is not inserted into DOM yet.
jQuery does nothing when calling `slideUp` on elements that are not inserted into the DOM yet, which can now be the case now when first loading the Customizer as the panels, sections and controls get dynamically inserted, see #28709.

props westonruter.
fixes #30251.

git-svn-id: https://develop.svn.wordpress.org/trunk@30307 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 22:36:51 +00:00
Dominik Schilling (ocean90)
63642323a5 Customizer: When navigating around the site within the Customizer preview, update the document title.
props westonruter.
fixes #28542.

git-svn-id: https://develop.svn.wordpress.org/trunk@30306 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 22:28:38 +00:00
Ian Stewart
88e80131df Twenty Fifteen: Minor formatting and docs tweaks, clearer variable name.
Props celloexpressions, see #29988



git-svn-id: https://develop.svn.wordpress.org/trunk@30305 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 19:35:40 +00:00
Ian Stewart
8454637689 Twenty Fifteen: simplify the code used to generate screen reader text for the is_home title.
Props davidakennedy, fixes #30305



git-svn-id: https://develop.svn.wordpress.org/trunk@30304 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 19:23:47 +00:00
Ian Stewart
eeda30610c Twenty Fifteen: create consistent spacing with embeds and images.
Props afercia, fixes #30286



git-svn-id: https://develop.svn.wordpress.org/trunk@30303 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 19:03:55 +00:00
Ian Stewart
85df1aea07 Twenty Fifteen: simpler CSS by using divs instead of spans for menu descriptions.
Props philiparthurmoore, fixes #30296



git-svn-id: https://develop.svn.wordpress.org/trunk@30302 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 19:01:47 +00:00
Boone Gorges
96eb9a93d9 Correct grammar error in WP_Date_Query error message.
Props Offereins.
See #25834.

git-svn-id: https://develop.svn.wordpress.org/trunk@30301 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 14:55:52 +00:00
Boone Gorges
a26cf7ba6e Improve localization for WP_Date_Query error strings.
* Don't create an extra variable for the string when it's only used once.
* Avoid using `<code>` HTML tags inside of translatable string.
* Improve data types and escaping on sprintfed values.

Props dd32.
Fixes #25834.

git-svn-id: https://develop.svn.wordpress.org/trunk@30300 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 13:24:01 +00:00
Gary Pendergast
c2fb136b47 wpdb: When flushing results on a mysqli connection, make sure that wpdb::$dbh is a valid mysqli connection handle.
Fixes a unit test failure introduced in [30297].

Fixes #28155.

Props soulseekah.



git-svn-id: https://develop.svn.wordpress.org/trunk@30299 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-11 02:16:19 +00:00
Boone Gorges
df11fb8593 Exclude external-http tests when running phpunit.
The external-http tests are very slow, and `Wp_Http` functionality is fairly
isolated, so the benefits of skipping these tests by default outweigh the
risks.

A `grunt phpunit:external-http` subtask has been added, to ensure that the
tests are executed during exhaustive runs of the test suite, such as in
continuous integration.

Fixes #30304.

git-svn-id: https://develop.svn.wordpress.org/trunk@30298 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 14:48:28 +00:00
Gary Pendergast
4b1aa89206 wpdb::flush() was not flushing results correctly when using mysqli.
This change also allows stored procedures or queries made with `mysqli_multi_query()` to be flushed.

Includes unit tests.

Fixes #28155.

Props soulseekah.


git-svn-id: https://develop.svn.wordpress.org/trunk@30297 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 05:39:50 +00:00
Andrew Ozz
c8340a2cda TinyMCE: enable direct calls to _WP_Editors::wp_mce_translation(). When using TinyMCE directly, this makes it easier to load the translation of the default strings. Fixes #30293.
git-svn-id: https://develop.svn.wordpress.org/trunk@30296 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 02:07:00 +00:00
Boone Gorges
3c360968ef Fix PHP notice in Tests_Feed_RSS2::test_items().
A notice was being thrown when `get_the_tags()` returned false, and `foreach()`
was run over that return value.

See [30283].

git-svn-id: https://develop.svn.wordpress.org/trunk@30295 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 02:04:22 +00:00
Andrew Ozz
d011f4ef00 TinyMCE: remove strings that are not translated before outputting the translations. Fixes #27797.
git-svn-id: https://develop.svn.wordpress.org/trunk@30294 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 01:59:23 +00:00
Andrew Ozz
18f75bf2f7 Heartbeat:
- Use the page visibility API (when available) and document.hasFocus() instead of window.onfocus/onblur. Improves speeding up/slowing down the interval and works for iframes by default.
- Add a setting for minimal interval. Maximum value is 10 min. This overrides all other intervals and cannot be changed after setting it at initialization. Can be used to reduce the frequency of requests on hosts that have low limits for used CPU time, etc.
- Extend the setting of interval to support 120 sec. (60 sec, is still the default).
- Always suspend after one hour of keyboard/mouse/touch inactivity.
Fixes #29779.

git-svn-id: https://develop.svn.wordpress.org/trunk@30293 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-10 01:46:04 +00:00
Gary Pendergast
3b3a33b583 WPDB's __get() function should perform strict comparisons against member names
git-svn-id: https://develop.svn.wordpress.org/trunk@30292 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-09 12:03:31 +00:00
Aaron Jorbin
218924d9ee Remove failing Unbalanced tags tests
Patch with tests added to #6297 for use in the future

Props MikeHansenMe for creating patch of current unit test

see #30284


git-svn-id: https://develop.svn.wordpress.org/trunk@30291 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 23:14:28 +00:00
Aaron Jorbin
44825185f7 Remove failing shortcode unit tests
Test added to #14050 in case we want to include it in a future fix.

see #30284



git-svn-id: https://develop.svn.wordpress.org/trunk@30290 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 22:50:30 +00:00
Aaron Jorbin
e7e27c2e4d Remove failing uploadfile test in trunk
The test has been added to #11946 and can be readded when that ticket is fixed.

Props MikeHansenMe for creating patch of current unit test

See #30284



git-svn-id: https://develop.svn.wordpress.org/trunk@30289 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:55:41 +00:00
Drew Jaynes (DrewAPicture)
68f8703893 Fix incorrect documentation in the DocBlocks for get_lastpostmodified() and _get_last_post_time().
Props ericlewis for the initial patch.
Fixes #30249.


git-svn-id: https://develop.svn.wordpress.org/trunk@30287 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:07:46 +00:00
Jeremy Felt
211c7ac373 Move tests for ms_files_rewriting to separate group, ms-files
When the `ms_files_rewriting` flag is enabled, `ms_upload_constants()` is required to properly set upload directory constants. Once this fires, it is impossible to clean up for a non `ms_files_rewriting` test by turning the option back off.

Excluding these tests by default offer a more consistent environment overall. Any tests written for uploaded files in multisite should ideally have a correspondign test in this area.

This commit also moves existing `ms_files_rewriting` tests for `test_switch_upload_dir()`.

Fixes #30256


git-svn-id: https://develop.svn.wordpress.org/trunk@30286 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:07:05 +00:00
Boone Gorges
ffcfc0573b Remove failing test related to post galleries.
It relied on the old _WPDataset technique, which is no longer used.

The test has been added to #UT30 as a patch, in case anyone wants to make
future use of it.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30285 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 21:01:39 +00:00
Drew Jaynes (DrewAPicture)
72cc949b5d Fix the syntax for some status-related documentation introduced in [30155].
* Variables in DocBlocks should be backtick-escaped
* Parameter and return types should be as specific as possible
* `@param` types and variables should align with each other, but not intentionally with the `@return` description

See #30230.


git-svn-id: https://develop.svn.wordpress.org/trunk@30284 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:55:14 +00:00
Boone Gorges
9b425eb5e4 Improve Tests_Feed_RSS2::test_items().
* Better reference to post author, to avoid PHP notices.
* Code styling.
* More reliable checking of tags and categories.

Props kurtpayne.
Fixes #UT32. See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30283 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:54:06 +00:00
Boone Gorges
13602b566d Remove failing unit tests from 'canonical' group.
Each removed test has been turned into a patch and posted to the open ticket
that it belongs to.

See #30284.

git-svn-id: https://develop.svn.wordpress.org/trunk@30282 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:36:27 +00:00
Drew Jaynes (DrewAPicture)
136b853399 Cross-reference WP_Comment_Query::query() as the location for finding information on default arguments for WP_Comment_Query.
Also updates the return types on `get_comments()` and `get_approved_comments()`, as an integer can also be returned if the `$count` argument is true.

Fixes #30111.


git-svn-id: https://develop.svn.wordpress.org/trunk@30281 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:35:00 +00:00
Drew Jaynes (DrewAPicture)
9df38af4f7 Document default arguments for WP_Comment_Query class as a hash notation.
Props boonebgorges, DrewAPicture.
See #30111.


git-svn-id: https://develop.svn.wordpress.org/trunk@30280 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:18:50 +00:00
Jeremy Felt
bcf340ff65 Use remove_added_uploads() in tearDown() for XMLRPC tests
This cleanup avoids false test failures due to incrementing filenames in the uploads directory.

Fixes #30290


git-svn-id: https://develop.svn.wordpress.org/trunk@30279 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 20:17:17 +00:00
Boone Gorges
608084a9cc In unit tests, use wpmu_delete_user() to delete users when is_multisite().
`wp_delete_user()` doesn't remove the user from the database, which causes all
sorts of problems in certain cases.

Props jeremyfelt.
See [30277], #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30278 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 19:55:05 +00:00
Boone Gorges
d63ceb08a3 Share fixtures across 'canonical' automated tests.
Sharing these fixtures results in a speed improvement of almost one minute per
run of the test suite.

My hope is that future WordPress developers will spend this extra minute with
their loved ones, for life on this earth is short, my friends, and the moments
you spend watching WP generate test data can never again be reclaimed from the
grizzled clutches of Time, and none of us are really getting younger, I mean,
geez, have you looked in the mirror lately, Gandalf?

See #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30277 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 19:28:12 +00:00
Boone Gorges
fe726039bd Share fixtures across a number of query-related test classes.
This shaves 10-20 seconds off the running time for the suite.

See #30017.

git-svn-id: https://develop.svn.wordpress.org/trunk@30276 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-08 15:29:31 +00:00
Ian Stewart
a4ecf4b080 Twenty Fifteen: updates to customize-preview.js missed in r30274.
Props celloexpressions, See #29988.



git-svn-id: https://develop.svn.wordpress.org/trunk@30275 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 21:10:10 +00:00
Ian Stewart
975ee2d0a8 Twenty Fifteen: add instant updating of color schemes to the customizer with postMessage.
Props celloexpressions, bradyvercher, westonruter, fixes #29988.




git-svn-id: https://develop.svn.wordpress.org/trunk@30274 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 20:54:48 +00:00
Ian Stewart
72e9e8d3ea Twenty Fifteen: Removing email obfuscation from social links menu.
We really should be doing this in all menus, at which point this becomes core or plugin functionality, not a theme feature.

Closes #30214.



git-svn-id: https://develop.svn.wordpress.org/trunk@30273 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 17:37:36 +00:00
Ian Stewart
8102942f58 Twenty Fifteen: adding help text to explain how color changes to header and sidebar are affected by responsive design.
Props iamtakashi, iandstewart, fixes #30165.



git-svn-id: https://develop.svn.wordpress.org/trunk@30272 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 17:30:29 +00:00
Ian Stewart
79ba410eae Twenty Fifteen: improve naming and documentation of customizer js files to match core filenaming conventions.
Props celloexpressions, fixes #30160.



git-svn-id: https://develop.svn.wordpress.org/trunk@30271 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 17:19:55 +00:00
Ian Stewart
900307e343 Twenty Fifteen: use antispambot to obfuscate email adresses in the social links menu.
Props tywayne, fixes #30214.



git-svn-id: https://develop.svn.wordpress.org/trunk@30270 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 16:45:53 +00:00
Ian Stewart
cdae4f352d Twenty Fifteen: update earlier patch to borders on linked images so we're not affecting the display of linked icons in widgets.
Props iamtakashi, fixes #29963.



git-svn-id: https://develop.svn.wordpress.org/trunk@30269 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 16:33:23 +00:00
Boone Gorges
f12b0f9aad Correct variable name in WP_UnitTestCase::temp_filename().
git-svn-id: https://develop.svn.wordpress.org/trunk@30268 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 01:36:05 +00:00
Boone Gorges
73eee04d38 Unset the default permalink structure after installing Multisite for automated tests.
Most of our unit tests that involve permalinks expect non-pretty permalinks;
this is the default setting for WP. However, when the test suite installs
multisite, `populate_network()` is run before WP recogizes itself as multisite,
which leads to pretty permalinks being set. This breaks a number of unit
tests in ways that are difficult to trace.

git-svn-id: https://develop.svn.wordpress.org/trunk@30267 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-07 01:24:19 +00:00
Boone Gorges
b09103c101 Use assertEqualSets() for some WP_Comment_Query tests.
git-svn-id: https://develop.svn.wordpress.org/trunk@30266 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-06 22:27:34 +00:00
Boone Gorges
642e826cd9 Don't force child_of=0 for non-hierarchical taxonomies in get_terms().
This forcing appears to have been introduced to save unnecessary queries, but
(a) in some cases it appeared to be causing *more* queries, and (b) it caused
incorrect results when the 'exclude_tree' param of `get_terms()` called
`get_terms()` on each item in the tree using the 'child_of' param.

Fixes #30275.

git-svn-id: https://develop.svn.wordpress.org/trunk@30265 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-06 21:46:18 +00:00
Boone Gorges
11843fe460 Add tests for get_adjacent_post_link() wrappers.
Props MikeHansenMe.
See #29663.

git-svn-id: https://develop.svn.wordpress.org/trunk@30264 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-06 20:16:10 +00:00
Boone Gorges
6f7880bcf4 In get_adjacent_post(), $excluded_terms should check term_id rather than term_taxonom_id.
See #29663, #22112.

git-svn-id: https://develop.svn.wordpress.org/trunk@30263 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-06 20:11:34 +00:00
Ian Stewart
49d5227e76 Twenty Fifteen: Our next-previous labels were reversed.
Props iamtakashi, fixes #30265.



git-svn-id: https://develop.svn.wordpress.org/trunk@30247 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-05 20:30:53 +00:00
Scott Taylor
5a2c0fef1e In get_page_children(), only check $page->ancestors once to avoid duplicates when the function recurses. Adds an argument, $ancestors.
Fixes #18962.


git-svn-id: https://develop.svn.wordpress.org/trunk@30246 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-05 20:04:55 +00:00
Scott Taylor
885502ecab Improve wp.media documentation.
Props ericlewis.
See #28459.


git-svn-id: https://develop.svn.wordpress.org/trunk@30245 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-05 19:38:20 +00:00
Scott Taylor
94e0d1b969 Improve wp.Uploader documentation.
Props ericlewis.
See #30260.


git-svn-id: https://develop.svn.wordpress.org/trunk@30244 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-05 19:36:27 +00:00