Commit Graph

436 Commits

Author SHA1 Message Date
Andrea Fercia
9c3344197d Accessibility: use aria-current for the paginated post links output by wp_link_pages().
Continues the introduction in core of the aria-current attribute after [41683], [41359], and [41371].

- changes the `wp_link_pages()` (see the `nextpage` quicktag) output to use an `aria-current` attribute on the current item
- adds `post-nav-links` and `post-page-numbers` CSS classes to help themes style these links
- updates the related tests

Props antonioeatgoat, alexstine.
Fixes #41859.

Built from https://develop.svn.wordpress.org/trunk@42440


git-svn-id: http://core.svn.wordpress.org/trunk@42270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-12 20:17:51 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Dion Hulse
5342b33a0b Template: Don't output an empty <ul> in the_meta() when a post only has protected metas.
Props campusboy1987, birgire.
Fixes #42629.

Built from https://develop.svn.wordpress.org/trunk@42225


git-svn-id: http://core.svn.wordpress.org/trunk@42054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-24 05:21:51 +00:00
Sergey Biryukov
400bc41731 I18N: Allow for post custom field name in the_meta() to be translated, e.g. to insert a non-breaking space before the colon.
Props audrasjb, johnbillion.
Fixes #41653.
Built from https://develop.svn.wordpress.org/trunk@41583


git-svn-id: http://core.svn.wordpress.org/trunk@41416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 11:28:46 +00:00
Sergey Biryukov
ba67e5f09c Docs: Correct filename references in duplicate hook comments for post_password_required filter.
Props coffee2code.
Fixes #41959.
Built from https://develop.svn.wordpress.org/trunk@41567


git-svn-id: http://core.svn.wordpress.org/trunk@41400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-22 18:34:45 +00:00
Drew Jaynes
a64aa2115d Docs: Correct a typo in the sort_column argument description for wp_page_menu().
h/t spacegrrl.
See #41017.

Built from https://develop.svn.wordpress.org/trunk@40898


git-svn-id: http://core.svn.wordpress.org/trunk@40748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-13 01:11:43 +00:00
Pascal Birchler
72c19648bc Load: Only load PasswordHash class when needed.
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems.

Props DavidAnderson, ketuchetan.
Fixes #39445.

Built from https://develop.svn.wordpress.org/trunk@40387


git-svn-id: http://core.svn.wordpress.org/trunk@40294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 18:01:42 +00:00
Sergey Biryukov
cff9bc5a43 Docs: Clarify that has_excerpt() checks if the post has a custom excerpt, not some generated excerpt.
See #35487.
Built from https://develop.svn.wordpress.org/trunk@40042


git-svn-id: http://core.svn.wordpress.org/trunk@39979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-05 14:35:46 +00:00
Sergey Biryukov
b0bcea2a18 Docs: Clarify that wp_list_pages() and get_pages() only work with hierarchical post types.
Props doublehhh.
Fixes #39369.
Built from https://develop.svn.wordpress.org/trunk@40027


git-svn-id: http://core.svn.wordpress.org/trunk@39964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-29 10:59:42 +00:00
John Blackbourn
efa99585e3 Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.
Props natereist, dlh
Fixes #39211

Built from https://develop.svn.wordpress.org/trunk@39599


git-svn-id: http://core.svn.wordpress.org/trunk@39539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-14 03:43:43 +00:00
Pascal Birchler
81a26f6900 Posts, Post Types: Add support for post type templates.
WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages.
While this feature is very helpful, it has always been limited to the 'page' post type and not was not available to other post types.

By opening up the page template functionality to all post types, we continue to improve the template hierarchy's flexibility.

In addition to the `Template Name` file header, the post types supported by a template can be specified using `Template Post Type: post, foo, bar`.
When at least one template exists for a post type, the 'Post Attributes' meta box will be displayed in the back end, without the need to add post type support for `'page-attributes'`. 'Post Attributes' can be customized per post type using the `'attributes'` label when registering a post type.

Props johnbillion, Mte90, dipesh.kakadiya, swissspidy.
Fixes #18375.
Built from https://develop.svn.wordpress.org/trunk@38951


git-svn-id: http://core.svn.wordpress.org/trunk@38894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 08:07:30 +00:00
Sergey Biryukov
4a95bfa4c2 Docs: In get_pages() and wp_list_pages(), note that post_status argument can also be an array.
Adjust the alignment of default argument values for better readability.

Props birgire, desrosj.
Fixes #38136.
Built from https://develop.svn.wordpress.org/trunk@38798


git-svn-id: http://core.svn.wordpress.org/trunk@38741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 01:10:31 +00:00
Pascal Birchler
561c136b8f Docs: Document global variables used by get_the_content().
Props goranseric, morganestes.
Fixes #37173.
Built from https://develop.svn.wordpress.org/trunk@38746


git-svn-id: http://core.svn.wordpress.org/trunk@38689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 17:00:29 +00:00
Sergey Biryukov
4058b11ccd Docs: Add a @since entry for the post_password_required filter introduced in [38603].
Use a third-person singular verb for the filter description.

See #38056.
Built from https://develop.svn.wordpress.org/trunk@38604


git-svn-id: http://core.svn.wordpress.org/trunk@38547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:37:29 +00:00
Aaron Jorbin
d31057a009 Posts: Add filter to allow overriding post_password_required return
Post Passwords are incredibly inflexible. One Password per site at a time and other limitations that can't really be changed without a backwards compatibility break.  This adds the ability for sites to change the password behavior such as doing per post passwords or allowing multiple passwords to be set in a browser. The possibilities are YUGE.

Additionally, it allows for a behavior other than returning a html form when a password is needed. This is important for non website use cases (such as in a restful API).

Fixes #38056. See #16483.
Props rmccue.


Built from https://develop.svn.wordpress.org/trunk@38603


git-svn-id: http://core.svn.wordpress.org/trunk@38546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:28:30 +00:00
Peter Wilson
6cdab630cd Menus: Improve documentation of new $item_spacing argument.
Adds `@since` tags for and improves description of the new `$item_spacing` argument added to `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()` in [38523].

Props johnbillion for copy.
See #35206.

Built from https://develop.svn.wordpress.org/trunk@38574


git-svn-id: http://core.svn.wordpress.org/trunk@38517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 05:32:03 +00:00
Peter Wilson
4131900722 Menus: Add white space option to wp_nav_menu() and wp_list_pages().
Adds an `item_spacing` option to the arguments array for the functions `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()`. `item_spacing` is a boolean accepting either `preserve` or `discard`.

Previously, certain CSS choices could result in a site's layout changing if `wp_nav_menu()` fell back to the default `wp_list_pages()` due to differences in the whitespace within the HTML. The new argument ensures a function outputs consistant HTML while maintaining backward compatibility.

Fixes #35206.

Built from https://develop.svn.wordpress.org/trunk@38523


git-svn-id: http://core.svn.wordpress.org/trunk@38464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-06 09:06:31 +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
Sergey Biryukov
2cc42e5dbb Docs: Improve the docs for the_title() and make them more consistent with the_title_attribute().
Props ixkaito, swissspidy.
Fixes #37732.
Built from https://develop.svn.wordpress.org/trunk@38348


git-svn-id: http://core.svn.wordpress.org/trunk@38289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-24 15:59:29 +00:00
Sergey Biryukov
35e3d7e37f I18N: Remove unnecessary context in wp_post_revision_title_expanded().
Props ramiy.
Fixes #37781.
Built from https://develop.svn.wordpress.org/trunk@38327


git-svn-id: http://core.svn.wordpress.org/trunk@38268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 01:46:31 +00:00
Sergey Biryukov
372a19a435 I18N: Replace unnecessary context with translator comments in wp_post_revision_title() and wp_post_revision_title_expanded().
Props ramiy.
Fixes #37778.
Built from https://develop.svn.wordpress.org/trunk@38324


git-svn-id: http://core.svn.wordpress.org/trunk@38265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-23 00:35:28 +00:00
Scott Taylor
76540c6010 Media: wp_get_attachment_link() fails to output text for non-images if the attachment post doesn't have a title and $text (argument #5) was not passed to the func. In this case, use the filename.
Props Jonnyauk, henry.wright.
Fixes #37343.

Built from https://develop.svn.wordpress.org/trunk@38295


git-svn-id: http://core.svn.wordpress.org/trunk@38236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-20 23:45:28 +00:00
Sergey Biryukov
139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for _doing_it_wrong(), _deprecated_function(), _deprecated_argument(), and _deprecated_file() throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Nikolay Bachiyski
4372cdf45d Admin: Escape attachment name in case it contains special characters
Built from https://develop.svn.wordpress.org/trunk@37774


git-svn-id: http://core.svn.wordpress.org/trunk@37739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-21 14:20:55 +00:00
Sergey Biryukov
aad01818a5 Themes: Make default "read more" link more accessible.
Add an `aria-label` with the post title to make it available for screen readers.

Props Kau-Boy.
Fixes #36572.
Built from https://develop.svn.wordpress.org/trunk@37706


git-svn-id: http://core.svn.wordpress.org/trunk@37672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 22:46:27 +00:00
Peter Wilson
47d26cd9fb DOCS: Replace HTTP links with HTTPS.
Replaces unsecure links in documentation and translator comments with their secure versions.

Props johnpgreen, netweb

Fixes #36993

Built from https://develop.svn.wordpress.org/trunk@37674


git-svn-id: http://core.svn.wordpress.org/trunk@37640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 04:50:33 +00:00
Drew Jaynes
9193013158 Docs: Apply inline @see tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

Fixes #36921.

Built from https://develop.svn.wordpress.org/trunk@37544


git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes
42d1936336 Docs: Standardize filter docs in wp-includes/post-template.php to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

Built from https://develop.svn.wordpress.org/trunk@37501


git-svn-id: http://core.svn.wordpress.org/trunk@37469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:28:53 +00:00
Drew Jaynes
f52a8cb1fa Docs: Remove/replace invalid inline @link tags in DocBlocks in wp-includes/*.
Fixes #36910.

Built from https://develop.svn.wordpress.org/trunk@37487


git-svn-id: http://core.svn.wordpress.org/trunk@37455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 17:39:28 +00:00
Dominik Schilling
40a4e2c3f2 Themes: Revert [36112]
Adding the `singular` class per default to the list of body classes is breaking the layout of Twenty Eleven and other themes. Twenty Eleven adds the `.singular` class only to single pages if the page doesn't use specific page templates.

Props flixos90, swissspidy.
Fixes #36510.
Built from https://develop.svn.wordpress.org/trunk@37249


git-svn-id: http://core.svn.wordpress.org/trunk@37215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-19 21:24:27 +00:00
Drew Jaynes
49ecfd6ae0 Docs: Use a third-person singular verb for the get_the_excerpt() DocBlock summary.
See #32246.

Built from https://develop.svn.wordpress.org/trunk@36942


git-svn-id: http://core.svn.wordpress.org/trunk@36910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 17:52:26 +00:00
Weston Ruter
055154cb65 Customize: Restore body class removed in [36837] for when custom logo is present.
The class name is `wp-custom-logo` and it will be toggled by JS in the Customizer preview when the custom logo is added or removed.

See #33755.
Fixes #35945.

Built from https://develop.svn.wordpress.org/trunk@36903


git-svn-id: http://core.svn.wordpress.org/trunk@36871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-09 19:33:27 +00:00
Konstantin Obenland
147d6d7d6c Customize: Site logos are custom logos.
Brings the nomenclature closer to custom headers and backgrounds.

See https://wordpress.slack.com/archives/core/p1456955151003150
See #35945. 

Built from https://develop.svn.wordpress.org/trunk@36837


git-svn-id: http://core.svn.wordpress.org/trunk@36804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-03 19:56:26 +00:00
Konstantin Obenland
237f6a0e58 Customize: Introduce Logo support for themes.
Allows a common theme feature to have a common implementation provided by core and available in a consistent location for users.
See https://make.wordpress.org/core/2016/02/24/theme-logo-support/

Props kwight, enejb, jeherve, bhubbard, samhotchkiss, zinigor, eliorivero, adamsilverstein, melchoyce, ryan, mikeschroder, westonruter, pento, karmatosed, celloexpressions, obenland. 
See #33755.


Built from https://develop.svn.wordpress.org/trunk@36698


git-svn-id: http://core.svn.wordpress.org/trunk@36665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 22:10:26 +00:00
Mel Choyce
0cafc9abe7 Forms: Swap "Submit" button label for "Enter" on password-protected pages.
Props karmatosed, SergeyBiryukov

See #35042.

Built from https://develop.svn.wordpress.org/trunk@36685


git-svn-id: http://core.svn.wordpress.org/trunk@36652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 16:25:25 +00:00
Pascal Birchler
4e978a1ce6 Posts: Correctly pass $post to post_password_required() in get_the_excerpt().
Corrects the relevant test.

Props sebastian.pisula for initial patch.
Fixes #35486.
Built from https://develop.svn.wordpress.org/trunk@36329


git-svn-id: http://core.svn.wordpress.org/trunk@36296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-16 10:14:28 +00:00
Pascal Birchler
552ed65d3b Post: After [36319], add $post parameter to the get_the_excerpt filter.
Props sebastian.pisula.
Fixes #35474.
Built from https://develop.svn.wordpress.org/trunk@36321


git-svn-id: http://core.svn.wordpress.org/trunk@36288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 19:28:26 +00:00
Pascal Birchler
10be93190e Posts: Add a $post parameter to get_the_excerpt().
This allows getting the excerpt for a specific post, similar to how most other template tags work.
A deprecation notice is thrown if a boolean value is passed, which is deprecated since 2.3 and has not been used for a long time.
Adds unit tests.

Fixes #27246.
Built from https://develop.svn.wordpress.org/trunk@36319


git-svn-id: http://core.svn.wordpress.org/trunk@36286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 14:47:26 +00:00
John Blackbourn
76c33b7e33 Themes: Add singular to the list of body classes when viewing a single post object.
Adds tests

Fixes #35164
Props danielpataki, johnbillion

Built from https://develop.svn.wordpress.org/trunk@36112


git-svn-id: http://core.svn.wordpress.org/trunk@36077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-28 17:21:29 +00:00
Sergey Biryukov
36e8fa050f Docs: Capitalize 'URL' correctly in the_guid() DocBlock. Fix a typo.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@35920


git-svn-id: http://core.svn.wordpress.org/trunk@35884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 05:21:26 +00:00
Sergey Biryukov
6d90a7b0cb Post Template: Pass the post ID to the_guid and get_the_guid filters.
Props danielbachhuber for initial patch.
Fixes #35015.
Built from https://develop.svn.wordpress.org/trunk@35867


git-svn-id: http://core.svn.wordpress.org/trunk@35831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 16:39:26 +00:00
Konstantin Obenland
77c6154881 Template: Defining a default value for show_home breaks back compat.
To add a home link to the fallback menu output many themes only check if that
argument is set. Including Twenty Ten and Twenty Eleven. They check with
`isset()` so child themes and other instances using `wp_page_menu()` have a
chance to disable the home link by setting it to `false`.

Fixes #11095.


Built from https://develop.svn.wordpress.org/trunk@35737


git-svn-id: http://core.svn.wordpress.org/trunk@35701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-25 18:55:26 +00:00
Sergey Biryukov
a46bf27781 Docs: After [35399], correct $class parameter type and description for post_class filter.
See #34452.
Built from https://develop.svn.wordpress.org/trunk@35400


git-svn-id: http://core.svn.wordpress.org/trunk@35364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-26 15:12:24 +00:00
Sergey Biryukov
16441a7766 In get_post_class(), ensure that we always coerce the class list passed to the function to an array, even when it's empty.
This is consistent with `get_body_class()`, see [18176].

See #34452.
Built from https://develop.svn.wordpress.org/trunk@35399


git-svn-id: http://core.svn.wordpress.org/trunk@35363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-26 15:09:26 +00:00
Sergey Biryukov
03a03f7dc6 Docs: Correct $class parameter type and description for body_class filter.
Props JPry.
Fixes #34452.
Built from https://develop.svn.wordpress.org/trunk@35398


git-svn-id: http://core.svn.wordpress.org/trunk@35362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-26 15:03:25 +00:00
Drew Jaynes
8544d69d35 Docs: Normalize spacing in the wp_get_attachment_link hook doc following [35065].
See #34257. See #32246.

Built from https://develop.svn.wordpress.org/trunk@35066


git-svn-id: http://core.svn.wordpress.org/trunk@35031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 16:44:24 +00:00
Drew Jaynes
ad628c7165 Docs: Adjust documentation for the $size parameter in the wp_get_attachment_link hook doc to clarify the required order of width and height values when an array is passed.
Also adds the `array` type to the parameter documentation (already supported).

See #34257.

Built from https://develop.svn.wordpress.org/trunk@35065


git-svn-id: http://core.svn.wordpress.org/trunk@35030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 16:42:23 +00:00
Drew Jaynes
4534f13149 Docs: Fix the syntax for marking parameters optional and add defaults in the DocBlock for wp_get_attachment_link().
See #32246.

Built from https://develop.svn.wordpress.org/trunk@35057


git-svn-id: http://core.svn.wordpress.org/trunk@35022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 16:15:24 +00:00
Drew Jaynes
69a3c2d8d7 Docs: Adjust documentation for the $size parameter in wp_get_attachment_link() to clarify the required order of width and height values when passing an array.
Also adds the `array` type to the parameter documentation (already supported).

Props jaspermdegroot.
See #34257.

Built from https://develop.svn.wordpress.org/trunk@35050


git-svn-id: http://core.svn.wordpress.org/trunk@35015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-12 15:56:24 +00:00
Konstantin Obenland
b5be742e1f Template: Add fallback for empty containers.
Since [14031] the container can be omitted in `wp_nav_menu()`. It can not
however in `wp_page_menu()`, which creates a conflict if it is set as
the fallback, Let's make sure there is always a valid container tag.

Fixes #33974.


Built from https://develop.svn.wordpress.org/trunk@34950


git-svn-id: http://core.svn.wordpress.org/trunk@34915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-08 18:27:25 +00:00