Sergey Biryukov
b4aaf3925d
Login and Registration: Change login label to Username or Email Address
for clarity.
...
Props GaryJ.
Fixes #37871 .
Built from https://develop.svn.wordpress.org/trunk@38477
git-svn-id: http://core.svn.wordpress.org/trunk@38418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 18:51:28 +00:00
Sergey Biryukov
fe12301ca9
Help/About: Remove an outdated help sentence on "My Sites" screen.
...
Props johnjamesjacoby.
Fixes #37896 .
Built from https://develop.svn.wordpress.org/trunk@38474
git-svn-id: http://core.svn.wordpress.org/trunk@38415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 17:44:29 +00:00
Scott Taylor
af71985625
Query: r38356, you were not long for this world.
...
Fixes #37830 .
Built from https://develop.svn.wordpress.org/trunk@38471
git-svn-id: http://core.svn.wordpress.org/trunk@38412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:53:29 +00:00
Scott Taylor
a3ffebce30
Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38470
git-svn-id: http://core.svn.wordpress.org/trunk@38411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:31:29 +00:00
Scott Taylor
7e8d7f8a81
General: revert [38386], functions.php
was probably too tempting for some people to not load by itself.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38469
git-svn-id: http://core.svn.wordpress.org/trunk@38410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:24:29 +00:00
Scott Taylor
0eebbed6b2
General: revert [38467], wp_is_IE()
should not exist.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38468
git-svn-id: http://core.svn.wordpress.org/trunk@38409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:22:31 +00:00
Scott Taylor
021e23e70b
General: use a new function, wp_is_IE()
, instead of the $is_IE
global in a number of places.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38467
git-svn-id: http://core.svn.wordpress.org/trunk@38408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:42:33 +00:00
Scott Taylor
69e7fe3c5b
Press This: don't check for already-hoisted global in press-this.php
.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38466
git-svn-id: http://core.svn.wordpress.org/trunk@38407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:29:28 +00:00
Scott Taylor
0419d1e318
Press This: in wp_ajax_press_this_save_post()
and wp_ajax_press_this_add_category()
, don't check for a global instance. WP_Press_This
is a Controller, but not really a Singleton. This also keeps it from being a pluggable class, which it is right now.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38465
git-svn-id: http://core.svn.wordpress.org/trunk@38406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:25:29 +00:00
Weston Ruter
9546303342
Customize: Improve handling of active state for dynamically-created controls/sections/panels.
...
When a customizer construct (panel, section, control) is not added in PHP, the JS has interpreted this to mean that a given construct should be deactivated (because it is gone). This is problematic for dynamically-created constructs in JS, as it has meant that the construct would also have to be created in PHP to ensure the `active` callback is called, or else a hack would be required to add a `construct.active.validate = function() { return true };` to forcibly prevent the construct from getting deactivated.
These workarounds can be eliminated by treating constructs differently when they are created dynamically in JS (after page load) as opposed to being created statically in PHP (on the server). Namely, if a construct is dynamically-created then its absence in a preview refresh should not signal that the construct should be deactivated. Rather, a dynamic construct should only have its activation state toggled if it has a corresponding construct created in PHP when the preview refreshes to explicitly indicate its `active` state. Otherwise, the management of the `active` state for a construct created in JS should also be the responsibility of client-side code.
Props westonruter, sayedwp.
Fixes #37270 .
Built from https://develop.svn.wordpress.org/trunk@38464
git-svn-id: http://core.svn.wordpress.org/trunk@38405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:22:23 +00:00
Scott Taylor
153ba4a832
Query: in wp_old_slug_redirect()
, use get_query_var()
instead of importing and touching the global $wp_query
directly.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38463
git-svn-id: http://core.svn.wordpress.org/trunk@38404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:21:41 +00:00
Scott Taylor
1dc37b77ef
Press This: in get_shortcut_link()
, just check a class constant on WP_Press_This
instead of instantiating the object and reading an instance prop.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38462
git-svn-id: http://core.svn.wordpress.org/trunk@38403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:08:00 +00:00
Scott Taylor
9383bf8f74
General: use get_bloginfo( 'version' )
instead of global $wp_version
in several locations - excluding those locations which reload version.php
mid-flight.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38459
git-svn-id: http://core.svn.wordpress.org/trunk@38400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:49:37 +00:00
Scott Taylor
cabb4a03c8
Multisite: use get_current_site()
instead of $GLOBALS['current_site']
(stop yelling!) in a few remaining spots.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38458
git-svn-id: http://core.svn.wordpress.org/trunk@38399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:04:29 +00:00
Scott Taylor
e5225324a2
Multisite: use get_current_blog_id()
where applicable, in lieu of plucking the $blog_id
global from outer space.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38457
git-svn-id: http://core.svn.wordpress.org/trunk@38398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 04:55:54 +00:00
John Blackbourn
049c36d11f
HTTP API: Revert changes to wp_parse_url()
while PHP 5.2 errors are investigated.
...
See #36356
Built from https://develop.svn.wordpress.org/trunk@38456
git-svn-id: http://core.svn.wordpress.org/trunk@38397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 00:24:31 +00:00
Scott Taylor
5d94d97b29
List Tables: AJAX actions for List Tables do not need to declare global $wp_list_table
. List tables on admin screens are in global scope, and they contain hooks that don't pass the the list table as context, hence using globals there so that functions can import them. That problem does not exist in the AJAX actions, which are virtually impossible to hook into as is.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38455
git-svn-id: http://core.svn.wordpress.org/trunk@38396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 20:07:29 +00:00
Scott Taylor
800fb85d1e
OEmbed: add unit tests. @group external-oembed
is not run by default.
...
Props johnbillion, wonderboymusic.
See #32360 .
Built from https://develop.svn.wordpress.org/trunk@38454
git-svn-id: http://core.svn.wordpress.org/trunk@38395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 18:55:28 +00:00
John Blackbourn
d412234bc1
HTTP API: Separate the test for wp_parse_url()
with -1
as its component into a separate test, so the remaining tests can use strict type checking. This helps avoid gotches with the potentially empty values (ie. null
) that we're testing for.
...
See #36356
Built from https://develop.svn.wordpress.org/trunk@38453
git-svn-id: http://core.svn.wordpress.org/trunk@38394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 18:31:30 +00:00
John Blackbourn
fad4b94bab
HTTP API: The tests for wp_parse_url()
can't be strict on type because this causes the tests to fail on PHP 5.2 which, bizarrely, returns the results of parse_url()
(when called with a $component
parameter) in a different order to later PHP versions.
...
Fixes #36356
Built from https://develop.svn.wordpress.org/trunk@38452
git-svn-id: http://core.svn.wordpress.org/trunk@38393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:49:29 +00:00
John Blackbourn
3a9cc4bf11
Posts, Post Types: Introduce a missing private query var that should have been introduced as part of #15459 .
...
This private query var allows the hierarchical page query on the Pages listing screen to query for `wp_posts.ID, wp_posts.post_parent` instead of `wp_posts.*`. This introduces large memory and time savings when the site contains a large number of Pages. Combined with the processing time savings introduced in [31730] this makes the Pages listing screen considerably more performant.
Fixes #34982
Props rodrigosprimo
Built from https://develop.svn.wordpress.org/trunk@38451
git-svn-id: http://core.svn.wordpress.org/trunk@38392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:40:30 +00:00
John Blackbourn
ebe159a4bc
HTTP API: Prevent a fatal error on PHP < 5.4.7 due to changes introduced in [38449].
...
Fixes #36356
Built from https://develop.svn.wordpress.org/trunk@38450
git-svn-id: http://core.svn.wordpress.org/trunk@38391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:16:30 +00:00
John Blackbourn
4fd9ad1ce2
HTTP API: Add a $component
parameter to wp_parse_url()
to give it parity with PHP's parse_url()
function.
...
Fixes #36356
Props jrf
Built from https://develop.svn.wordpress.org/trunk@38449
git-svn-id: http://core.svn.wordpress.org/trunk@38390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 16:36:28 +00:00
Andrea Fercia
99be6ffd3c
Accessibility: Hide the "No activity yet" smiley from assistive technologies.
...
Fixes #37511 .
Built from https://develop.svn.wordpress.org/trunk@38448
git-svn-id: http://core.svn.wordpress.org/trunk@38389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 16:14:30 +00:00
Pascal Birchler
4753f6e127
Script Loader: Properly adjust tests missed in [38443].
...
See #37800 .
Built from https://develop.svn.wordpress.org/trunk@38447
git-svn-id: http://core.svn.wordpress.org/trunk@38388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:51:28 +00:00
Boone Gorges
3a4169d7ab
Comments: Don't do direct SQL query when fetching decendants.
...
The SQL query was built using the clauses compiled when querying for
top-level comments. But in cases where the top-level comment query
results are already in the cache, the SQL clauses are not built, and
so are unavailable for `fill_descendants()`. Instead, we call
`get_comments()`, using modified versions of the parameters passed
to the main `WP_Comment_Query` class.
Props Akeif, Rarst for testing.
Fixes #37696 .
Built from https://develop.svn.wordpress.org/trunk@38446
git-svn-id: http://core.svn.wordpress.org/trunk@38387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:48:29 +00:00
Boone Gorges
28cc6cb368
Tests: Require Basic_Object
and Basic_Subclass
files earlier in call stack.
...
This ensures compatibility with third-party tools using these classes
in their test suites, after [38285].
Props DylanAuty, Frank Klein, TimothyBlynJacobs.
Fixes #37523 .
Built from https://develop.svn.wordpress.org/trunk@38445
git-svn-id: http://core.svn.wordpress.org/trunk@38386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:33:28 +00:00
Boone Gorges
ded1bb5625
Tests: Add docblocks for Basic_Object
and Basic_Subclass
classes.
...
Props DylanAuty.
See #37523 .
Built from https://develop.svn.wordpress.org/trunk@38444
git-svn-id: http://core.svn.wordpress.org/trunk@38385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:32:32 +00:00
Sergey Biryukov
c2b62878aa
Script Loader: Close the <link>
tag in wp_resource_hints()
.
...
Props Chaos Engine.
Fixes #37800 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38443
git-svn-id: http://core.svn.wordpress.org/trunk@38384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 11:20:43 +00:00
Gary Pendergast
dd9aaba852
Database: Don't force an unsupported character set that previously would've silently failed.
...
[37320] corrected some behaviour in how PHP and MySQL character sets are matched up. This was correct, but had the side effect of causing some incorrectly configured sites to start failing.
Prior to [37320], if `DB_CHARSET` was set to `utf8mb4`, but the PHP version didn't support `utf8mb4`, it would fall back to the default character set - usually `latin1`. After [37320], the `SET NAMES` query would force MySQL to treat the connection character set as `utf8mb4`, even if PHP wasn't able to understand it.
By checking if `mysqli_set_charset()` succeeded, we can simulate the old behaviour, while maintaining the fix in [37320].
Props danielkanchev fo helping to diagnose this issue.
Fixes #37689 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38441
git-svn-id: http://core.svn.wordpress.org/trunk@38382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 07:38:32 +00:00
Gary Pendergast
bd084204c1
Database: Ensure that variables are defined correctly.
...
There were some cases where some local variables in `wpdb::init_charset()` could be undefined when they were used.
Props Frozzare.
Fixes #37683 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38439
git-svn-id: http://core.svn.wordpress.org/trunk@38380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 07:14:41 +00:00
Scott Taylor
3f51e08ac6
i18n: after r38364, check that global $wp_locale
is an instance of WP_Locale
before calling ->is_rtle()
in is_rtl()
.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38438
git-svn-id: http://core.svn.wordpress.org/trunk@38379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 05:57:41 +00:00
Boone Gorges
d793020f1e
Remove unnecessary uniqueness check in get_attachment_taxonomies()
.
...
Running the taxonomy array through `array_unique()` is unnecessary
when the function returns objects, because the associative keys already
ensure uniqueness.
This also fixes a bug when running `get_attachment_taxonomies()` in
HHVM, which doesn't like casting objects to strings for the purposes
of `array_unique()`.
Props swissspidy.
See #37368 .
Built from https://develop.svn.wordpress.org/trunk@38437
git-svn-id: http://core.svn.wordpress.org/trunk@38378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 03:07:34 +00:00
Weston Ruter
abd9cdc07b
Customize: Allow users to more seamlessly create page-based nav menus during customization.
...
Introduces the ability to create stubs for the various post types to add to a given menu. This eliminates the need to leave the customizer to first create the post in the admin and then return to managing menus. Only the title of the newly-created post can be supplied; the post content will be blank and will need to be provided in the normal edit post screen outside the customizer, unless a plugin enables a post editing in the customizer experience. When a post is created and added to a nav menu in the customizer, the newly created post that is added to a menu is given the `auto-draft` status, and if the changes are not published, the `auto-draft` post will be automatically deleted within 7 days via `wp_delete_auto_drafts()`. However, if the customizer changes are saved, then these nav menu item `auto-draft` post stubs will be transitioned to `publish`.
Includes portions of code from the Customize Posts <https://github.com/xwp/wp-customize-posts > and Front-end Editor <https://github.com/iseulde/wp-front-end-editor > plugins.
For more information, see https://make.wordpress.org/core/2016/06/16/feature-proposal-content-authorship-in-menus-with-live-preview/
Props celloexpressions, westonruter, valendesigns, afercia, melchoyce, mapk, iseulde, mrahmadawais.
Fixes #34923 .
Built from https://develop.svn.wordpress.org/trunk@38436
git-svn-id: http://core.svn.wordpress.org/trunk@38377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 22:59:28 +00:00
Andrea Fercia
42c4653c9a
Accessibility: Improve the file upload inputs styling.
...
Though browsers implement `cursor: pointer` on this kind of controls a bit
inconsistently, the `pointer` cursor styling makes more clear the button and
label are actionable controls.
Props Ankit K Gupta.
Fixes #35552 .
Built from https://develop.svn.wordpress.org/trunk@38435
git-svn-id: http://core.svn.wordpress.org/trunk@38376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 21:08:29 +00:00
John Blackbourn
27770f200c
Themes: Correct the type for the $name
parameter of the get_header
, get_footer
, get_sidebar
, and get_template_part_{$slug}
hooks.
...
See #37770
Built from https://develop.svn.wordpress.org/trunk@38434
git-svn-id: http://core.svn.wordpress.org/trunk@38375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 20:42:30 +00:00
Joe McGill
0569c6219e
Post Thumbnails: Prevent post thumbnail previews from spilling into other images.
...
After [38118], when previewing a page with a secondary loop, all post
thumbnails would be filtered to display the post thumbnail for the
page being previewed. This ensures `_wp_preview_post_thumbnail_filter()`
is only applied if the `$post_id` of the post meta being filtered is
equal to the post or page being previewed.
Props swisspidy, joemcgill.
Fixes #37697 .
Built from https://develop.svn.wordpress.org/trunk@38433
git-svn-id: http://core.svn.wordpress.org/trunk@38374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 12:25:29 +00:00
John Blackbourn
a96f20f9b5
Comments: Add support for all HTTP protocol versions when returning a 405 from wp-comments-post.php
.
...
Fixes #37863
Props tnash
Built from https://develop.svn.wordpress.org/trunk@38432
git-svn-id: http://core.svn.wordpress.org/trunk@38373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 12:00:32 +00:00
Dion Hulse
56bc1dc194
Bootstrap: Check that ini_get_all()
exists before calling it, allows us to work around hosts who disable the function for "security purposes".
...
Fixes #37680 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38431
git-svn-id: http://core.svn.wordpress.org/trunk@38372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 02:59:30 +00:00
Dion Hulse
30270d851f
HTTP: Accept non-string values in cookies, fixing a regression since 4.5.
...
Props swissspidy.
Fixes #37768 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38430
git-svn-id: http://core.svn.wordpress.org/trunk@38371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 02:42:45 +00:00
Dion Hulse
e45ebb28f2
HTTP: Handle an edgecase within the URI parsing library included in Requests, where if a double slash exists at the start of the path the URL is passed to cURL malformed.
...
Props flixos90 for initial patch.
Fixes #37733 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38429
git-svn-id: http://core.svn.wordpress.org/trunk@38370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-29 02:33:34 +00:00
John Blackbourn
b3faafc632
Themes: Correct the list of possible values for the dynamic portion of the {$type}_template_hierarchy
and {$type}_template
filters.
...
See #14310
Built from https://develop.svn.wordpress.org/trunk@38428
git-svn-id: http://core.svn.wordpress.org/trunk@38369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 23:57:49 +00:00
Andrew Ozz
2b0e81c595
TinyMCE: change the default font for the vi
locale to the same stack as he_IL
.
...
Props nmt90 for reporting and testing this.
Fixes #37755 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38427
git-svn-id: http://core.svn.wordpress.org/trunk@38368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 18:52:41 +00:00
Andrew Ozz
bbc12c3dbe
Editor: fix jumpiness on pressing backspace and delete in the Text editor.
...
Fixes #37690 for trunk.
Built from https://develop.svn.wordpress.org/trunk@38426
git-svn-id: http://core.svn.wordpress.org/trunk@38367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 18:40:31 +00:00
Ella Iseulde Van Dorpe
b67367b6f8
Editor: Use Beacon API over sync request
...
See https://www.w3.org/TR/beacon/ for more information.
Built from https://develop.svn.wordpress.org/trunk@38425
git-svn-id: http://core.svn.wordpress.org/trunk@38366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 18:29:30 +00:00
John Blackbourn
dbdc1c28b1
I18N: Correct various instances of incorrect usage of esc_attr_e()
.
...
Fixes #37457
Props henry.wright, afercia
Built from https://develop.svn.wordpress.org/trunk@38424
git-svn-id: http://core.svn.wordpress.org/trunk@38365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 18:06:30 +00:00
John Blackbourn
a7c3974cdc
Upgrade/Install: Don't display PHP errors during installation.
...
If a user is installing WordPress for the first time and has set `WP_DEBUG` to true, a PHP error during installation makes for a visually jarring experience.
Fixes #37358
Built from https://develop.svn.wordpress.org/trunk@38423
git-svn-id: http://core.svn.wordpress.org/trunk@38364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:50:29 +00:00
John Blackbourn
348c50b2a8
Formatting: Add a parameter to wp_send_json_error()
, wp_send_json_success()
, and wp_send_json()
for specifying the HTTP response code.
...
Defaults to `200` in all cases, but can be used, for example, to return a `403` when using `wp_send_json_error()`.
Fixes #35666
Props stephenharris
Built from https://develop.svn.wordpress.org/trunk@38422
git-svn-id: http://core.svn.wordpress.org/trunk@38363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:42:28 +00:00
John Blackbourn
a1d61a95e1
Security: Return a 403
instead of a 200
HTTP status when check_ajax_referer()
fails.
...
This is, unfortunately, untestable in the current test suite, even in the AJAX tests.
Fixes #36362
Built from https://develop.svn.wordpress.org/trunk@38421
git-svn-id: http://core.svn.wordpress.org/trunk@38362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:31:30 +00:00
John Blackbourn
b85e322e35
Security: Trigger a _doing_it_wrong()
when check_ajax_referer()
is called without its first parameter. This brings it inline with check_admin_referer()
.
...
Fixes #36361
Built from https://develop.svn.wordpress.org/trunk@38420
git-svn-id: http://core.svn.wordpress.org/trunk@38361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 17:15:28 +00:00
John Blackbourn
6b3a3713fd
Themes: Introduce tests for the theme template hierarchy.
...
See #14310
Built from https://develop.svn.wordpress.org/trunk@38419
git-svn-id: http://core.svn.wordpress.org/trunk@38360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 16:19:28 +00:00
John Blackbourn
d346835bfb
Themes: Update filter names in the inline documentation for the get_*_template()
functions.
...
See #14310 , #37770
Built from https://develop.svn.wordpress.org/trunk@38418
git-svn-id: http://core.svn.wordpress.org/trunk@38359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 16:15:30 +00:00
John Blackbourn
5985804f1f
Permalinks: Correct an invalid peramstructure tag in a test.
...
Fixes #37858
Built from https://develop.svn.wordpress.org/trunk@38417
git-svn-id: http://core.svn.wordpress.org/trunk@38358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 12:53:29 +00:00
Pascal Birchler
a09d7f3615
Bootstrap: Fix failing external HTTP tests after [38411].
...
When testing the transports, the transport name needs to be capitalized for the class name to be correct (`WP_Http_Curl` vs. `WP_Http_curl` ).
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38416
git-svn-id: http://core.svn.wordpress.org/trunk@38357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 10:34:30 +00:00
Pascal Birchler
ac83e26875
Upgrade/Install: After [37687], fix the number of params passed to the upgrade hooks.
...
`wp_version_check()`, `wp_update_plugins()` and `wp_update_themes()` are all originally hooked to the `upgrader_process_complete` action with zero arguments passed to them. Zero arguments should be passed when re-adding them after translation updates, otherwise the sky will fall.
Props ionutst, gitlost.
Fixes #37731 .
Built from https://develop.svn.wordpress.org/trunk@38415
git-svn-id: http://core.svn.wordpress.org/trunk@38356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 10:04:30 +00:00
Scott Taylor
f96fff3c9d
Admin: allow WP_Screen
to be checked via autoload in convert_to_screen()
.
...
Props kraftbj.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38414
git-svn-id: http://core.svn.wordpress.org/trunk@38355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 02:25:27 +00:00
John Blackbourn
17db8134c4
Query: Add and improve tests for query conditionals on the front page and home page.
...
See #37851
Built from https://develop.svn.wordpress.org/trunk@38413
git-svn-id: http://core.svn.wordpress.org/trunk@38354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 02:02:32 +00:00
Scott Taylor
2a9b372471
Script Loader: autoload in load-{scripts|styles}.php
.
...
Props JohnPBloch.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38412
git-svn-id: http://core.svn.wordpress.org/trunk@38353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-28 00:07:33 +00:00
Scott Taylor
390ceba6c7
Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
...
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38411
git-svn-id: http://core.svn.wordpress.org/trunk@38352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 22:32:37 +00:00
Scott Taylor
1798d34f73
Bootstrap: run composer install
after r38409.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38410
git-svn-id: http://core.svn.wordpress.org/trunk@38351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 19:09:30 +00:00
Scott Taylor
4bf37e5555
Bootstrap: move composer.{json|lock}
into src
.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38409
git-svn-id: http://core.svn.wordpress.org/trunk@38350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 19:06:31 +00:00
John Blackbourn
e0a0be9579
Media: Add a $wp_error
parameter to wp_insert_attachment()
to give it parity with wp_insert_post()
.
...
Fixes #37813
Props grapplerulrich, mrahmadawais
Built from https://develop.svn.wordpress.org/trunk@38408
git-svn-id: http://core.svn.wordpress.org/trunk@38349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 17:25:29 +00:00
John Blackbourn
d194f60a5c
Build/Test tools: Ensure the Tests_Query_Conditionals
tests set up the environment correctly before re-registering initial taxonomies.
...
Fixes #37851
Built from https://develop.svn.wordpress.org/trunk@38407
git-svn-id: http://core.svn.wordpress.org/trunk@38348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 17:03:33 +00:00
John Blackbourn
9070bb3ace
Users: Correct the documentation for the wp_dropdown_users_args
filter description and its parameters.
...
See #37770
Built from https://develop.svn.wordpress.org/trunk@38406
git-svn-id: http://core.svn.wordpress.org/trunk@38347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 16:54:31 +00:00
John Blackbourn
4739cc0075
Build/Test Tools: Add support for is_front_page()
to assertQueryTrue()
and assert that all the tested conditions are supported by the method.
...
Fixes #37849
Built from https://develop.svn.wordpress.org/trunk@38405
git-svn-id: http://core.svn.wordpress.org/trunk@38346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 15:28:28 +00:00
Dion Hulse
ec83ce1a0c
i18n: Retire another remaining wp-includes/locale.php
require, and instead load the required WP_Locale
class directly.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38404
git-svn-id: http://core.svn.wordpress.org/trunk@38345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 15:13:33 +00:00
John Blackbourn
71e8e8368a
Themes: Remove failing tests introduced in [38390].
...
See #14310
Built from https://develop.svn.wordpress.org/trunk@38403
git-svn-id: http://core.svn.wordpress.org/trunk@38344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 14:53:38 +00:00
Dion Hulse
0e31a46161
Bootstrap: Revert [38399] as it's broken /build/
and subsequently core.svn.wordpress.org.
...
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.
See #36335
Built from https://develop.svn.wordpress.org/trunk@38402
git-svn-id: http://core.svn.wordpress.org/trunk@38343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 14:37:32 +00:00
Pascal Birchler
8b5fc84e63
After [38399], update the .gitignore
file accordingly.
...
The following files have been added to `svn:ignore` already as they are not compatible with PHP 5.2:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38401
git-svn-id: http://core.svn.wordpress.org/trunk@38342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 11:29:28 +00:00
Peter Wilson
62717837b5
Unit tests: Enforce $args object in wp_nav_menu()
& Walker_Nav_Menu
.
...
WordPress always* passes $args to filters as an array of arugments. A exception is made in `wp_nav_menu()` and the associated walker where these are passed to filters as an object, this has been the case for seven years (since [13368]).
These new tests enforce the use of an object in these filters to ensure backward compatibility is maintained.
See #24587 .
Built from https://develop.svn.wordpress.org/trunk@38400
git-svn-id: http://core.svn.wordpress.org/trunk@38341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 11:28:30 +00:00
Scott Taylor
6a529648cf
Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
...
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.
The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php
We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php
When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.
The future is now.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38399
git-svn-id: http://core.svn.wordpress.org/trunk@38340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 09:15:29 +00:00
Scott Taylor
cb74a4401b
Unit Tests:
...
* Automatically delete objects that we were created during `wpSetUpBeforeClass` - posts, comments, terms (except 1), and user (except 1)
* The amount of leftover data between tests was breathtaking - use the new function: `_delete_all_data()`
* Commit database transactions for all `TestCase`s, not just those that implement `wpSetUpBeforeClass` and `wpTearDownAfterClass`
* The tests run 10-20 seconds faster now
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38398
git-svn-id: http://core.svn.wordpress.org/trunk@38339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 08:36:31 +00:00
Scott Taylor
85d63f2af5
Press This: the file for the WP_Press_This
class should not produce side effects. Similar to what we did in r38355 for WP_Site_Icon
, drop the instances of global
instantiation for $wp_press_this
via loading the file. The variable can be set inline when necessary. In most of those places, if the global is already set, the file does not load and stomp it currently.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38397
git-svn-id: http://core.svn.wordpress.org/trunk@38338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 06:07:29 +00:00
Weston Ruter
e6ed174135
Customize: Circumvent the customizer attempting to preview links to static assets (such as uploaded images).
...
The customizer's preview POST requests to static assets result in 405 Method Not Allowed responses.
Fixes #37828 .
Built from https://develop.svn.wordpress.org/trunk@38396
git-svn-id: http://core.svn.wordpress.org/trunk@38337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 06:05:29 +00:00
Scott Taylor
e05a033bcb
Bootstrap: exclude more files from the autoloader.classmap
in composer.json
.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38395
git-svn-id: http://core.svn.wordpress.org/trunk@38336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 05:40:29 +00:00
Scott Taylor
599d45019f
Bootstrap: add composer.lock
and src/wp-vendor
files. Nothing is using this code yet, just going through the motions. Ignore the files in src/wp-vendor/composer
that will explode in PHP 5.2.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38394
git-svn-id: http://core.svn.wordpress.org/trunk@38335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 03:49:28 +00:00
Scott Taylor
bb16c53108
Bootstrap: run composer require xrstf/composer-php52
to get the updated suggested version. Change the vendor-dir
to wp-vendor
.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38393
git-svn-id: http://core.svn.wordpress.org/trunk@38334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 03:36:29 +00:00
Scott Taylor
06aa510d56
List Tables: move _WP_List_Table_Compat
into its own file.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38392
git-svn-id: http://core.svn.wordpress.org/trunk@38333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 22:23:29 +00:00
Scott Taylor
99aef2df30
Bootstrap: exclude some files from the Composer autoload setup via exclude-from-classmap
.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38391
git-svn-id: http://core.svn.wordpress.org/trunk@38332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 22:21:31 +00:00
John Blackbourn
3c6dd1d00d
Themes: Begin introducing unit tests for the expected theme template hierarchy. More to come.
...
See #14310
Built from https://develop.svn.wordpress.org/trunk@38390
git-svn-id: http://core.svn.wordpress.org/trunk@38331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 22:20:28 +00:00
Scott Taylor
c99df3a708
XML-RPC: break up class-IXR.php
into individual class files.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38389
git-svn-id: http://core.svn.wordpress.org/trunk@38330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 22:08:33 +00:00
Scott Taylor
08233c6aff
Multisite: move get_current_site()
to load.php
so that it can be used in more places, instead of importing global $current_site
.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38388
git-svn-id: http://core.svn.wordpress.org/trunk@38329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:35:30 +00:00
Scott Taylor
35bdc07eac
Roles: set a property, $db
, on WP_Roles
to reduce global imports.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38387
git-svn-id: http://core.svn.wordpress.org/trunk@38328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:16:59 +00:00
Scott Taylor
b9f516e55e
Bootstrap: load option.php
in wp-settings.php
, not in functions.php
.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38386
git-svn-id: http://core.svn.wordpress.org/trunk@38327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:11:29 +00:00
John Blackbourn
9e1542b9ec
Themes: Make the template hierarchy for a given template type filterable.
...
This introduces a `{$type}_template_hierarchy` filter that allows the hierarchy of candidate template filenames for a given template type to be filtered.
This allows the hierarchy to be added to or altered completely without resorting to re-building the hierarchy from scratch within the `template_include` filter, which is common and prone to conflicts between plugins and prone to getting out of sync with core's hierarchy.
Fixes #14310
Built from https://develop.svn.wordpress.org/trunk@38385
git-svn-id: http://core.svn.wordpress.org/trunk@38326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:03:27 +00:00
Scott Taylor
29959d0448
Bootstrap: add a composer.json
file to the project. No code relies on it (yet), and no vendor
dir is checked in (yet). No autoloader is being used (yet). Taking this first step will hopefully encourage the perfectionists of our world to scrutinize each line.
...
To fiddle around with what it does, run `composer install` from the project root. If you do not have Composer installed:
https://getcomposer.org/doc/00-intro.md#locally
tl;dr for Mac/Homebrew users: `brew install composer`
Classes from `wp-includes` and `wp-admin` are eligible for autoloading via `autoload.classmap`. Through a tornado of recent commits, many unsuitable files have been transitioned into a more acceptable state for autoloading: 1 file per class, no side effects.
The file bootstrap in `wp-settings.php` can transition into `autoload.files`. This will be done with care and attention.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38384
git-svn-id: http://core.svn.wordpress.org/trunk@38325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 21:00:29 +00:00
Scott Taylor
525bb21513
Unit Tests: after r38303, replace usage of global $_wp_additional_image_sizes
with wp_get_additional_image_sizes()
.
...
See #37699 .
Built from https://develop.svn.wordpress.org/trunk@38383
git-svn-id: http://core.svn.wordpress.org/trunk@38324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 20:51:43 +00:00
John Blackbourn
3644bc160f
Build/Test Tools: Remove many unnecessary calls to rand_str()
which can, in theory, fail at random. Static strings are much more appropriate.
...
See #37371
Built from https://develop.svn.wordpress.org/trunk@38382
git-svn-id: http://core.svn.wordpress.org/trunk@38323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 20:22:43 +00:00
Boone Gorges
0b81d79c86
Don't improperly cast IDs when fetching post, user, or term objects.
...
Blindly casting passed IDs to integers can generate false positives
when the ID is cast to `1`.
Props deeptiboddapati.
Fixes #37738 .
Built from https://develop.svn.wordpress.org/trunk@38381
git-svn-id: http://core.svn.wordpress.org/trunk@38322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 19:09:27 +00:00
Scott Taylor
11216c7069
FTP: ensure that there is only one class named ftp
, which is what is expected in the loading of this arcane library. This ensures that an autoload generator, something along the lines of Composer, won't hiccup when it gets to these files.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38380
git-svn-id: http://core.svn.wordpress.org/trunk@38321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:47:29 +00:00
Scott Taylor
b1c6049be4
Upgrade/Install: wp-admin/includes/class-wp-upgrader-skins.php
is unused, remove it. All of the same includes are loaded in class-wp-upgrader.php
.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38379
git-svn-id: http://core.svn.wordpress.org/trunk@38320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:25:30 +00:00
John Blackbourn
32d5e7f31d
Role/Capability: Only users who can manage options should be able to trash/delete the page for posts or the front page, as they are the only users who can restore it or subsequently alter the "Front page displays" setting.
...
Fixes #37580
Props JakePT
Built from https://develop.svn.wordpress.org/trunk@38378
git-svn-id: http://core.svn.wordpress.org/trunk@38319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:23:31 +00:00
Boone Gorges
3d593c5fc1
Eliminate unnecessary variable in WP_Term_Query
.
...
Props ocean90.
Fixes #37544 .
Built from https://develop.svn.wordpress.org/trunk@38377
git-svn-id: http://core.svn.wordpress.org/trunk@38318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:12:26 +00:00
Scott Taylor
b3d474a6dc
Load: move WP_MatchesMapRegex
into its own file.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38376
git-svn-id: http://core.svn.wordpress.org/trunk@38317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:11:39 +00:00
Scott Taylor
b2c394a330
Script Loader: move _WP_Dependency
into its own file.
...
See #37827 .
Built from https://develop.svn.wordpress.org/trunk@38375
git-svn-id: http://core.svn.wordpress.org/trunk@38316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 18:06:39 +00:00
Scott Taylor
76c7864367
Load: remove class-feed.php
(There is no class named Feed
or WP_Feed
, it just loads other classes) and, instead, move the require
calls to the only place they are ever included: inside fetch_feed()
. This simplifies the include path.
...
Tested with this feed in a widget: `http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml `.
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38374
git-svn-id: http://core.svn.wordpress.org/trunk@38315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 17:53:30 +00:00
Scott Taylor
524effb58f
Load: remove session.php
and, instead, move the 2 require
calls to wp-settings.php
. This simplifies the include path.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38373
git-svn-id: http://core.svn.wordpress.org/trunk@38314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 17:45:17 +00:00
Boone Gorges
51a2235c19
Use shared fixture in comment_exists()
tests.
...
Props Frank Klein.
Fixes #37842 .
Built from https://develop.svn.wordpress.org/trunk@38372
git-svn-id: http://core.svn.wordpress.org/trunk@38313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 17:42:50 +00:00
Scott Taylor
481123661c
Load: load class-phpass.php
(PasswordHash
class) early in wp-settings.php
, instead of require_once()
'ing it in several places.
...
See #36335 .
Built from https://develop.svn.wordpress.org/trunk@38371
git-svn-id: http://core.svn.wordpress.org/trunk@38312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 17:40:35 +00:00
John Blackbourn
f189b72b22
Docs: Alignment after [38369].
...
See #37770
Built from https://develop.svn.wordpress.org/trunk@38370
git-svn-id: http://core.svn.wordpress.org/trunk@38311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 16:51:28 +00:00