Commit Graph

8234 Commits

Author SHA1 Message Date
Boone Gorges
283c38c022 Improve lazyloading of comment meta in WP_Query loops.
Lazy-loading logic is moved to a method on `WP_Query`. This makes it possible
for comment feeds to take advantage of metadata lazyloading, in addition to
comments loaded via `comments_template()`.

This new technique parallels the termmeta lazyloading technique introduced in
[34704].

Fixes #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34711 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:34:54 +00:00
Scott Taylor
686ef2bd79 List Tables: .column-date needs to become wider at smaller screen sizes, bump it from 10% to 14% at the breakpoint to prevent wrapping.
Fixes #32691.


git-svn-id: https://develop.svn.wordpress.org/trunk@34710 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:24:33 +00:00
Scott Taylor
876c8611f1 Revert [34083], I was willing to try this out for the greater good. The good was not greater. There is too much baggage associated with this specific change as pertains to BC and expected layout.
See #32691.


git-svn-id: https://develop.svn.wordpress.org/trunk@34709 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:18:55 +00:00
Scott Taylor
427f4fe063 Rewrite: allow add_rewrite_rule|WP_Rewrite::add_rule() to accept an associative array for the value of $redirect instead of requiring a query string.
Adds unit tests.

Props scribu, DrewAPicture.
Fixes #16840.


git-svn-id: https://develop.svn.wordpress.org/trunk@34708 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 01:10:03 +00:00
Scott Taylor
27bc50cef8 List Tables: only hide bulk actions when there are no items, don't hide all of the extra table nav.
Fixes #33824.


git-svn-id: https://develop.svn.wordpress.org/trunk@34707 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-30 00:46:15 +00:00
Drew Jaynes
2b8df0b47a Docs: Add an @see reference for the "use-instead-of" function in the DocBlock for force_ssl_login(), deprecated in [34700].
See #34011. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34706 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 22:45:56 +00:00
Drew Jaynes
0150a52379 Users: Add the default arguments array as a second parameter to the wp_dropdown_users_args filter, introduced in [34692].
Adjust hook doc descriptions accordingly.

See #19867.


git-svn-id: https://develop.svn.wordpress.org/trunk@34705 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 22:38:12 +00:00
Boone Gorges
e75f2c024f Improve lazyloading of term metadata in WP_Query loops.
[34529] introduced lazyloading for the metadata belonging to terms matching
posts in the main `WP_Query`. The current changeset improves this technique
in the following ways:

* Term meta lazyloading is now performed on the results of all `WP_Query` queries, not just the main query.
* Fewer global variable touches and greater encapsulation.
* The logic for looping through posts to identify terms is now only performed once per `WP_Query`.

Props dlh, boonebgorges.
See #34047.

git-svn-id: https://develop.svn.wordpress.org/trunk@34704 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:59:44 +00:00
Scott Taylor
e04d0dd623 Customizer: make "Current header" clickable in the same way that "Background Image" is - will open the media modal.
Props umesh.nevase.
Fixes #33586.


git-svn-id: https://develop.svn.wordpress.org/trunk@34702 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:39:55 +00:00
Scott Taylor
3d06ffcbbc Network Upgrade: switch <h3> to <h2>.
Props afercia.
Fixes #34082.


git-svn-id: https://develop.svn.wordpress.org/trunk@34701 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:27:42 +00:00
John Blackbourn
0058018799 Deprecate force_ssl_login(), which is simply a wrapper for force_ssl_admin() and is not used in core.
Fixes #34011


git-svn-id: https://develop.svn.wordpress.org/trunk@34700 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 21:27:40 +00:00
Boone Gorges
49063d8e14 WP_Query should not ignore an offset of 0.
Props mazurstas.
Fixes #34060.

git-svn-id: https://develop.svn.wordpress.org/trunk@34697 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 19:36:16 +00:00
Boone Gorges
3b7187eade Fix 'exclude_tree' in wp_list_categories().
The 'exclude_tree' parameter must be compatible with 'hierarchical';
previously, 'hierarchical' canceled it out. This changeset also makes it so
that 'exclude_tree' is compatible with 'exclude'. When both are passed, and
'hierarchical' is true, the descendant trees of terms in both parameters will
be excluded from matched terms.

Props tott, webord, MikeHansenMe.
Fixes #12981.

git-svn-id: https://develop.svn.wordpress.org/trunk@34696 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 19:11:12 +00:00
Andrea Fercia
c81fe78b9c Bump H3 headings to H2 on the Network Settings screen for better accessibility.
Fixes #34078.

git-svn-id: https://develop.svn.wordpress.org/trunk@34695 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 18:51:20 +00:00
John Blackbourn
644632bec5 Revert the introduction of validation of the comment author's email address when sanity checking input in wp-comments-post.php (introduced in r34274). This allows a problematic email address to fall through to the correct validation routine and show the "Please enter a valid email address" as expected.
Fixes #23416


git-svn-id: https://develop.svn.wordpress.org/trunk@34693 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 17:26:44 +00:00
Drew Jaynes
077854484d Users: Introduce the wp_dropdown_users_args filter, making it possible to filter the arguments for wp_dropdown_users() before the query is run.
The 'name' argument (or the `WP_Screen` object if in the admin) can be used to help target specific instances of `wp_dropdown_users()` via this hook.

Props norcross.
See #19867.


git-svn-id: https://develop.svn.wordpress.org/trunk@34692 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 15:39:26 +00:00
John Blackbourn
a8f9ae8161 On the Permalink Settings screen, add a link to the Nginx documentation when the current site is running Nginx. This is in lieu of showing actual Nginx configuration like we do for mod_rewrite or IIS.
Fixes #18852


git-svn-id: https://develop.svn.wordpress.org/trunk@34691 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 11:14:23 +00:00
Gary Pendergast
ce14a63214 Permalinks: Add pretty permalinks for unattached attachments.
Previously, unattached attachments would have unsightly `/?attachment_id=1` URLs. As we've moved away from attachments being specifically attached to posts, instead being Media items, this has made the unattached URLs a more common occurrence.

We can breath easy once more, knowing that the world is a little bit safer from the horror of unnecessarily ugly URLs.

Props SergeyBiryukov, wonderboymusic, pento.

Fixes #1914.



git-svn-id: https://develop.svn.wordpress.org/trunk@34690 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 09:41:14 +00:00
DrewAPicture
133b204471 Docs: Move the hook doc to once again directly precede the hook line for the getarchives_where filter following [34686].
See #21596.


git-svn-id: https://develop.svn.wordpress.org/trunk@34689 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 06:38:02 +00:00
Scott Taylor
1ac3ba0828 Allow wp_get_archives() to accept post_type as an arg.
Adds unit test.

Fixes #21596.


git-svn-id: https://develop.svn.wordpress.org/trunk@34686 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 05:10:10 +00:00
Gary Pendergast
070b65dcfc Rewrite: Redirect attachment URLs when their slug changes.
Using the same logic that we use to redirect posts when their slug changes, we can provide the same functionality for attachments. Attachment pages are posts, too.

Props swissspdy.

Fixes #34043.



git-svn-id: https://develop.svn.wordpress.org/trunk@34685 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:57:02 +00:00
Scott Taylor
0ab0525691 Edit Media: wrap long filenames in the Publish meta box.
Fixes #34069.


git-svn-id: https://develop.svn.wordpress.org/trunk@34684 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:50:08 +00:00
Scott Taylor
999e54c8d3 RSS Widget: add a class, rss-widget-icon, to the RSS icon to allow devs to hide it. Not going to remove to not break visual BC.
Fixes #22010.


git-svn-id: https://develop.svn.wordpress.org/trunk@34683 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:31:10 +00:00
Scott Taylor
948ab018d2 XML-RPC: calculate the proper offset for GMT in wp.newPost, mw.newPost, and mw.editPost when post_date is set, wp.editComment when comment_date is set. post|comment_date is assumed to be GMT. This is only true if the timezone string for the site matches GMT.
Adds unit tests for each.

Props smerriman, justdaiv, wonderboymusic.
Fixes #30429.


git-svn-id: https://develop.svn.wordpress.org/trunk@34681 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 04:04:16 +00:00
Boone Gorges
36af857315 Don't require explicit taxonomy when getting terms by term_taxonomy_id.
Props wonderboymusic.
Fixes #30620.

git-svn-id: https://develop.svn.wordpress.org/trunk@34679 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 03:51:11 +00:00
Drew Jaynes
3edc3b46f2 Introduce get_the_author_posts_link(), which returns the HTML link to the author page for the current post's author.
`the_author_posts_link()` has in-turn been converted into a wrapper, with most of its logic moved to the new function.

Adds tests for the new function.

Props chipbennett, zrothauser, wonderboymusic, DrewAPicture.
Fixes #30355.


git-svn-id: https://develop.svn.wordpress.org/trunk@34677 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 01:48:47 +00:00
Jeremy Felt
fbce07b386 Docs: Clarify $user parameter documentation in wpmu_validate_blog_signup.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34676 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 01:32:47 +00:00
John Blackbourn
f0200152be Revert r34674 due to failures on PHP < 5.4.
See #16859


git-svn-id: https://develop.svn.wordpress.org/trunk@34675 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 01:00:17 +00:00
John Blackbourn
2183725c54 Avoid stripping square brackets from URLs, and instead correctly encode them.
Square brackets must be encoded in the path, path parameters, query parameters, and fragment, but must not be encoded in anything up to the domain and port.

Adds a bunch of tests, including square brackets in query parameters, IPv6 URLs, and several other permutations.

See #16859


git-svn-id: https://develop.svn.wordpress.org/trunk@34674 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-29 00:40:30 +00:00
Jeremy Felt
8f4a6370f0 Fixes #33816.
MS: Adjust formatting of code in `site-new.php` to improve readability.

Fixes #34066.


git-svn-id: https://develop.svn.wordpress.org/trunk@34673 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 23:29:40 +00:00
Jeremy Felt
bf4846985f MS: Delete rewrite_rules when updating a switched site's URL.
Previously, rewrite rules could be flushed and regenerated in the context of another site. Deleting the rules when in a switched state allows for them to be generated properly on the next page view.

Fixes #33816.


git-svn-id: https://develop.svn.wordpress.org/trunk@34672 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 23:23:44 +00:00
Helen Hou-Sandi
94f596278c Sample permalink: Buttons still need the .button class.
Also fixes unit tests post-[34670]. The test methods have been slightly renamed because it is no longer a button. Hopefully this name will be more future-proof.

see #18306.


git-svn-id: https://develop.svn.wordpress.org/trunk@34671 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 22:06:15 +00:00
Helen Hou-Sandi
106f0b7b7b Edit: Remove the redundant "View Post" button-link and link the sample permalink.
Previously there were two persistent "View Post" links on an edit screen: next to the permalink and in the toolbar. This would then become three links after a post was published or updated, as a link is also included in the admin notice. This is a lot of redundancy and visual noise for a flow that is not your primary action upon starting to edit a post. The "View Post" link next to the sample permalink was particularly bad because it is styled like a button, but unlike a button, does not keep you on the current screen.

Because the permalink is now linked, there is no highlighted slug that you can click to edit, but rather just the "Edit" button.

props scribu, lessbloat, sabreuse, SergeyBiryukov, DrewAPicture, helen.
see #18306.


git-svn-id: https://develop.svn.wordpress.org/trunk@34670 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 20:09:19 +00:00
Boone Gorges
f261d3ac8a Fix comment_order for single page comment threads.
The old comment pagination logic had a separate block for comment threads that
appeared on a single page. After the refactoring in [34561], all comment
pagination logic is unified.

This change ensures that 'comment_order' is respected in all scenarios.

Fixes #8071.

git-svn-id: https://develop.svn.wordpress.org/trunk@34669 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 19:29:22 +00:00
John Blackbourn
ac85963ad4 Correctly slash post fields when trashing and untrashing posts.
Fixes #27550
Props dmenard, Denis-de-Bernardy


git-svn-id: https://develop.svn.wordpress.org/trunk@34668 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 19:25:05 +00:00
John Blackbourn
9271360932 Correct the logic used when determining whether to display the 'Mine' link on post list tables. It should only be shown when the count for the user's posts differs for the total count of posts. is_multi_author() cannot be used because it only considers Posts.
Fixes #19609


git-svn-id: https://develop.svn.wordpress.org/trunk@34667 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 19:14:56 +00:00
John Blackbourn
aaa6e1c27e Add a nav_menu_item_title filter for filtering nav menu item titles.
Fixes #33447
Props paulwilde


git-svn-id: https://develop.svn.wordpress.org/trunk@34666 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 18:40:56 +00:00
John Blackbourn
01ae35dc58 Add a missing @param doc for confirm_another_blog_signup().
See #32246


git-svn-id: https://develop.svn.wordpress.org/trunk@34665 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 17:57:05 +00:00
John Blackbourn
8823432749 Update get_the_post_thumbnail_url() so it returns false on failure, to bring it inline with wp_get_attachment_image_url(). Correct and introduce new tests.
Fixes #33070


git-svn-id: https://develop.svn.wordpress.org/trunk@34663 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 15:33:12 +00:00
Drew Jaynes
7fce79698a Widgets: Pass $instance to the widget_nav_menu_args filter in the Custom Menu widget.
Props walterbarcelos for the initial patch.
Fixes #33944.


git-svn-id: https://develop.svn.wordpress.org/trunk@34662 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 15:30:21 +00:00
Boone Gorges
c1d7e7f5aa In get_page_of_comment(), use a true COUNT query.
This improves memory usage by not compiling a list of comment IDs.

See #34057.

git-svn-id: https://develop.svn.wordpress.org/trunk@34661 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 15:09:46 +00:00
Boone Gorges
05e0a3b97e Use correct 'page_id' parameter in get_page_of_comment().
See #34057.

git-svn-id: https://develop.svn.wordpress.org/trunk@34660 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 15:09:34 +00:00
Gary Pendergast
6d87c4cecb Rewrite: When redirecting old slugs, include URL endpoints.
Historically, `wp_old_slug_redirect()` has only ever redirected the old slug of posts, it hasn't included URL endpoints, or worked with comment feed URLs. By adding support for these, we ensure a greater range of URLs aren't killed when the slug changes.

Props swissspdy.

Fixes #33920.



git-svn-id: https://develop.svn.wordpress.org/trunk@34659 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 06:56:54 +00:00
Scott Taylor
b59df508cf Theme Editor: ensure that files named index.php in theme subfolders are not labeled as "Main Index Template"
Props MikeHansenMe, wonderboymusic, bravokeyl, Shelob9.
Fixes #27201.


git-svn-id: https://develop.svn.wordpress.org/trunk@34658 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 03:10:08 +00:00
Scott Taylor
9d0f206ee1 After [34629], use $size_class instead of $size.
See #32093.


git-svn-id: https://develop.svn.wordpress.org/trunk@34657 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 02:49:05 +00:00
Gary Pendergast
2b78c9579a WPDB: Make sure we don't run sanity checks on DB dropins.
Previously, we'd run the sanity checks if `is_mysql` was not set to `false`. This caused problems for DB drop-ins that didn't define `is_mysql` at all. Instead, we can just check if `is_mysql` is `empty()`.

Also fix some unit tests that accidently ran correctly because of the strict `false ===` comparison.

Fixes #33501.



git-svn-id: https://develop.svn.wordpress.org/trunk@34655 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-28 01:16:29 +00:00
Scott Taylor
a155c5dcfd After [34200], force 'before' and 'after' to <ul> and </ul> when wp_nav_menu() falls back to wp_page_menu().
See #11095.


git-svn-id: https://develop.svn.wordpress.org/trunk@34653 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-27 23:38:32 +00:00
Drew Jaynes
8594d93d7b Docs: Improve the hook documentation for the plugins_api_args filter.
Standardizes the hook doc summary and expands on the expected type for the `$args` parameter.

See #34035. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34652 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-27 23:02:47 +00:00
Drew Jaynes
df542a1802 Docs: Improve the hook documentation for the themes_api filter.
Standardizes the hook doc summary and expands on expected behavior when short-circuiting the request, which is dependent on the `$action` type.

Also updates the expected types on the `$override` parameter.

See #34036. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34651 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-27 23:00:08 +00:00
Drew Jaynes
c6c2afd70b Docs: Normalize the data table spacing in the themes_api() DocBlock following a typo fix in [34649].
See #34036.


git-svn-id: https://develop.svn.wordpress.org/trunk@34650 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-27 22:48:06 +00:00