Commit Graph

658 Commits

Author SHA1 Message Date
Sergey Biryukov
06bb67be06 Docs: Correct back-compat reference to $excluded_categories in get_adjacent_post().
See #46543, #17673.
Built from https://develop.svn.wordpress.org/trunk@45033


git-svn-id: http://core.svn.wordpress.org/trunk@44842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 14:45:51 +00:00
Sergey Biryukov
0416de3294 General: Pass $pagenum argument to get_pagenum_link filter.
Props dimadin.
Fixes #46667.
Built from https://develop.svn.wordpress.org/trunk@45031


git-svn-id: http://core.svn.wordpress.org/trunk@44840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-27 14:24:52 +00:00
Sergey Biryukov
5658305b1c Date/Time: Reduce explicit local current_time( 'timestamp' ) usage in favor of native PHP functions.
Timestamps don't carry any timezone information, using the intended format directly simplifies the logic and makes the code less confusing.

Props Rarst, jdgrimes.
See #40657.
Built from https://develop.svn.wordpress.org/trunk@44809


git-svn-id: http://core.svn.wordpress.org/trunk@44641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-07 09:12:51 +00:00
Gary Pendergast
bf43978730 Link Template: In get_adjacent_post(), move the sanitisation of $excluded_terms earlier.
This is a followup to [42828], ensuring that the `get_{$adjacent}_post_excluded_terms` filter is always passed an array, as expected.

Props soulseekah, zottto.
Fixes #43521.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 01:54:49 +00:00
Gary Pendergast
eeac928d3b Comments: Add a new is_avatar_comment_type() function.
This function splits the `get_avatar_comment_types` filter out of `get_avatar_data()`.

Props dshanske, birgire.
Fixes #44033.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 06:00:51 +00:00
Sergey Biryukov
930079c8a5 Users: Remove unnecessary is_null() call in get_avatar_data().
The `! is_null()` portion of the condition is unnecessary, because `isset()` checks whether a variable is set *and* is not null.

Props JPry.
Fixes #44927.
Built from https://develop.svn.wordpress.org/trunk@44351


git-svn-id: http://core.svn.wordpress.org/trunk@44181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-20 02:49:48 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Sergey Biryukov
ac338b1666 Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().
Props desrosj, birgire, ianbelanger, Ov3rfly.
Fixes #44192.
Built from https://develop.svn.wordpress.org/trunk@43506


git-svn-id: http://core.svn.wordpress.org/trunk@43335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-07-18 11:50:25 +00:00
iandunn
c9c3c61a53 Privacy: Add template tags for building link to privacy policy page.
This introduces the `get_the_privacy_policy_link()` and `the_privacy_policy_link()` functions, as well as the `privacy_policy_url` filter.

A new `tests/url/` folder was added to better organize tests related to `get_*_url()` functions. Previously, those tests were placed in `tests/url.php` and `tests/link/`, but neither of those locations are optimal. Placing tests in `tests/url.php` violates the guideline of creating separate files/classes for each function under test, and using `tests/link/` conflates two distinct -- albeit related -- groups of functions. Over time, URL-related tests can be migrated to the new folder.

Props birgire, xkon, azaozz, iandunn.
See #43850.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-25 15:55:21 +00:00
Andrew Ozz
cf0d00c602 Privacy: fix get_privacy_policy_url() to only return the URL when the page is published.
See #43435.
Built from https://develop.svn.wordpress.org/trunk@42995


git-svn-id: http://core.svn.wordpress.org/trunk@42824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-20 14:44:20 +00:00
Andrew Ozz
3108d2ffb2 Privacy: add a postbox that is shown when editing the privacy policy page, and where plugins and core will output suggested content and additional privacy info. First run.
Props melchoyce, azaozz.
See #43620.
Built from https://develop.svn.wordpress.org/trunk@42980


git-svn-id: http://core.svn.wordpress.org/trunk@42809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-16 08:53:20 +00:00
Sergey Biryukov
81500e50ef Link Template: Apply get_{$adjacent}_post_excluded_terms filter to an empty excluded_terms parameter as well.
Props soulseekah, zottto.
Fixes #43521.
Built from https://develop.svn.wordpress.org/trunk@42828


git-svn-id: http://core.svn.wordpress.org/trunk@42658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-11 17:32:31 +00:00
Sergey Biryukov
395667f916 Comments: After [42703], make sure $args['type'] in paginate_comments_links() is always defined.
Props anantajitjg.
Fixes #43299.
Built from https://develop.svn.wordpress.org/trunk@42736


git-svn-id: http://core.svn.wordpress.org/trunk@42566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-25 16:08:30 +00:00
Sergey Biryukov
0a97d79899 Comments: Avoid a PHP notice in paginate_comments_links() if type argument is set to array.
The function is a wrapper for `paginate_links()`, which returns an array if requested.

Props anantajitjg.
Fixes #43299.
Built from https://develop.svn.wordpress.org/trunk@42703


git-svn-id: http://core.svn.wordpress.org/trunk@42531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-12 21:12:35 +00:00
John Blackbourn
91464bce65 Docs: Add missing code formatting to various @since entries.
See #42505

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


git-svn-id: http://core.svn.wordpress.org/trunk@42506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-09 16:55:31 +00:00
Sergey Biryukov
7c77266b9b Docs: Remove extra dot from some @since tags.
Props hardik-amipara.
Fixes #42899.
Built from https://develop.svn.wordpress.org/trunk@42400


git-svn-id: http://core.svn.wordpress.org/trunk@42229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-15 05:16:47 +00:00
Sergey Biryukov
7ec3bfe1ce Permalinks: Remove unnecesary temporary variable in get_permalink().
Props JPry, danimalbrown.
Fixes #41981.
Built from https://develop.svn.wordpress.org/trunk@42378


git-svn-id: http://core.svn.wordpress.org/trunk@42207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-07 14:50:46 +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
Gary Pendergast
c90cfa3b50 General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Sergey Biryukov
4865841343 Posts, Post Types: Pass the order parameter to get_{$adjacent}_post_sort filter.
Props manchumahara.
Fixes #41924.
Built from https://develop.svn.wordpress.org/trunk@41589


git-svn-id: http://core.svn.wordpress.org/trunk@41422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 23:01:44 +00:00
Andrew Ozz
a5f8097899 Retire Press This and extract it to a plugin. First run.
Props kraftbj, azaozz.
See #41689.
Built from https://develop.svn.wordpress.org/trunk@41584


git-svn-id: http://core.svn.wordpress.org/trunk@41417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-24 14:22:54 +00:00
Sergey Biryukov
5fe8d31118 Link Template: Allow the type argument to be passed through get_the_comments_pagination() as long as its value isn't array.
See [30820] for `get_the_posts_pagination().

Props jainnidhi, poena.
Fixes #39792.
Built from https://develop.svn.wordpress.org/trunk@41236


git-svn-id: http://core.svn.wordpress.org/trunk@41076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-08-09 04:07:43 +00:00
Felix Arntz
6625f0c551 Multisite: Introduce a self_admin_url filter to adjust the URL to an administration panel.
Props j.hoffmann.
Fixes #37446.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-14 23:01:42 +00:00
Drew Jaynes
0fe9fb4a16 Link Template: Clarify documentation for the $id parameter in get_post_permalink(), get_edit_post_link(), edit_post_link(), and get_delete_post_link(), to reflect that either a post ID or WP_Post object is accepted.
Separately, use `$post` for checking the post status and retrieving the page_uri in `get_post_permalink()` instead of referencing back to the original `$id` parameter.

Props GunGeekATX for the initial patch.
Fixes #40780.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 03:29:42 +00:00
Drew Jaynes
c5da335097 Docs: Fix a typo in the description for the get_previous_post_link() $link parameter. The default value is '%title', not '%title%'.
Props kmgalanakis.
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-25 06:20:43 +00:00
John Blackbourn
80a839de13 Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer

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


git-svn-id: http://core.svn.wordpress.org/trunk@39579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 09:28:40 +00:00
Felix Arntz
d784b5552c Multisite: Replace is_super_admin() with manage_network in get_dashboard_url().
Unit tests for `get_dashboard_url()` have been added.

Props iaaxpage.
Fixes #39065. See #37616.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-12 22:41:39 +00:00
Drew Jaynes
33b8bb3cf3 Docs: Clarify descriptions for home_url() and get_home_url() on the true effect of the $scheme parameter.
Part props thomaswm.
Props stevenlinx.
Fixes #36468.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 07:06:32 +00:00
Dominik Schilling
7cce73a634 General: Introduce a wp_list_sort() helper function, v2.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

This was previously committed in [38859] but got reverted in [38862] and [38863]. To fix the previous issues, `wp_list_sort()` supports now an additional argument to preserve array keys via `uasort()`.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38928


git-svn-id: http://core.svn.wordpress.org/trunk@38871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:26:32 +00:00
Dominik Schilling
6c8508023f Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.
Built from https://develop.svn.wordpress.org/trunk@38863


git-svn-id: http://core.svn.wordpress.org/trunk@38806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 17:01:32 +00:00
Pascal Birchler
f54558e75b General: Introduce a wp_list_sort() helper function.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38859


git-svn-id: http://core.svn.wordpress.org/trunk@38802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:12:51 +00:00
Jeremy Felt
1560fbcbc5 Multisite: Use get_network() and get_current_network_id() for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:47:30 +00:00
John Blackbourn
b84023ea33 Taxonomy: Introduce more fine grained capabilities for managing taxonomy terms.
This introduces the singular `edit_term`, `delete_term`, and `assign_term` meta capabilities for terms, and switches the base capability name for tags from `manage_categories` to `manage_post_tags` and the corresponding `edit_post_tags`, `delete_post_tags`, and `assign_post_tags`.

All of these capabilities ultimately map to `manage_categories` so by default there is no change in the behaviour of the capabilities for categories, tags, or custom taxonomies. The `map_meta_cap` filter and the `capabilities` argument when registering a taxonomy now allow for control over editing, deleting, and assigning individual terms, as well as a separation of capabilities for tags from those of categories.

Fixes #35614
Props johnjamesjacoby for feedback

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


git-svn-id: http://core.svn.wordpress.org/trunk@38641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:40:28 +00:00
Sergey Biryukov
bae2b337f0 Docs: Add home and commentpaged as accepted values for user_trailingslashit filter.
Props sebastian.pisula.
Fixes #37734.
Built from https://develop.svn.wordpress.org/trunk@38645


git-svn-id: http://core.svn.wordpress.org/trunk@38588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 22:54:29 +00:00
Jeremy Felt
58f107fa95 Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 21:39:29 +00:00
Sergey Biryukov
0bae73682b I18N: Correct context for Next/Previous strings in get_the_posts_pagination().
Props FlorianBrinkmann.
Fixes #37952.
Built from https://develop.svn.wordpress.org/trunk@38611


git-svn-id: http://core.svn.wordpress.org/trunk@38554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-15 09:20:29 +00:00
Sergey Biryukov
b6397b4fda Docs: Use a third-person singular verb in the DocBlock summary for get_theme_file_uri(), get_parent_theme_file_uri(), get_theme_file_path(), and get_parent_theme_file_path(), introduced in [38578].
See #18302.
Built from https://develop.svn.wordpress.org/trunk@38606


git-svn-id: http://core.svn.wordpress.org/trunk@38549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:48:28 +00:00
Sergey Biryukov
4d7e41653e Docs: Use a third-person singular verb for theme_file_uri, parent_theme_file_uri, theme_file_path, and parent_theme_file_path filters added in [38578].
See #18302.
Built from https://develop.svn.wordpress.org/trunk@38605


git-svn-id: http://core.svn.wordpress.org/trunk@38548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:45:29 +00:00
John Blackbourn
e6e6cbf21f Taxonomy: Revert accidental changes introduced in [38578].
See #18302

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


git-svn-id: http://core.svn.wordpress.org/trunk@38522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 22:58:28 +00:00
John Blackbourn
c0bb9c2562 Themes: Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes.
The most useful function this introduces is `get_theme_file_uri()`, which returns the URL to the specified file in the child theme if it exists, and falls back to the URL to the specified file in the parent theme. This allows parent themes to reference files (including enqueuing CSS and JavaScript files) that can be overridden by the child theme simply by existing.

This change also introduces `get_theme_file_path()`, which is the file path equivalent of `get_theme_file_uri()`.

Finally, `get_parent_theme_file_uri()` and `get_parent_theme_file_path()` are also introduced, which allow a theme to specifically reference a file URL or file path in the parent theme. These can be used as replacements for `get_template_directory_uri()` and `get_template_directory()` respectively, for consistency.

Props johnbillion, georgestephanis, gma992.
Fixes #18302

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


git-svn-id: http://core.svn.wordpress.org/trunk@38521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 22:54:32 +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
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
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
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
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
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
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
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
John Blackbourn
94c8ca0f2e Docs: Correct various documentation around object and stdClass types.
See #37770

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


git-svn-id: http://core.svn.wordpress.org/trunk@38310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-26 16:49:45 +00:00
Drew Jaynes
e6267dcf19 Docs: Fix formatting, tense, verb conjugation, and other syntax for wp-includes/* elements introduced or changed in 4.6.
Part 2/2.

Fixes #37318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-20 19:33:30 +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
Sergey Biryukov
247e33934c Permalinks: Avoid a PHP notice in get_permalink() if default category is unavailable.
Props Presskopp.
Fixes #36529.
Built from https://develop.svn.wordpress.org/trunk@37707


git-svn-id: http://core.svn.wordpress.org/trunk@37673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-14 23:12:28 +00:00
Dominik Schilling
e50f357944 Canonical: Introduce wp_get_canonical_url().
`wp_get_canonical_url()` encapsulates the URL logic of `rel_canonical()` to provide a consistent way to retrieve the canonical URL for a post.
The new filter `get_canonical_url` allows to customize the canonical URL.

Props joostdevalk, jipmoors, DrewAPicture, ocean90.
Fixes #36168.
Built from https://develop.svn.wordpress.org/trunk@37685


git-svn-id: http://core.svn.wordpress.org/trunk@37651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-11 13:31:29 +00:00
Drew Jaynes
e7e20e4b54 Docs: Update the return description for get_preview_post_link() to note that it can also return null.
Props chris_dev, swissspidy.
See #35915.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-25 18:25:28 +00:00
Drew Jaynes
d28f1a08ef 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.

See #36921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:01:27 +00:00
Drew Jaynes
c1ba18d147 Docs: Standardize filter docs in wp-includes/link-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@37499


git-svn-id: http://core.svn.wordpress.org/trunk@37467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:27:27 +00:00
Drew Jaynes
fe3b007fdd Docs: Remove inline @see tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Drew Jaynes
49e3bc83dd Docs: Capitalize URL – an acronym for Uniform Resource Locator – when used in the context of inline docs in wp-includes/link-template.php.
Fixes #30406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 14:47:28 +00:00
Drew Jaynes
a368295c37 Docs: Notate more optional parameter defaults for a variety of function DocBlocks in wp-includes/link-template.php.
See #30406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 14:37:29 +00:00
Drew Jaynes
e58b8ad732 Docs: Notate optional parameter defaults for a variety of function DocBlocks in wp-includes/link-template.php.
See #30406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-20 06:32:29 +00:00
Drew Jaynes
396018ab34 Docs: Properly notate optional parameters as such in a variety of DocBlocks in wp-includes/link-template.php.
See #30406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-19 23:21:27 +00:00
Rachel Baker
a0eab11bc1 Comments: Add parameters to edit_comment_link() to allow specifying a Comment and link class.
Matches the parameters for `edit_post_link()`.

Fixes #36538.

Props flixos90.
Built from https://develop.svn.wordpress.org/trunk@37215


git-svn-id: http://core.svn.wordpress.org/trunk@37181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-15 20:59:29 +00:00
Drew Jaynes
994bfb5b26 Docs: Use third-person singular verbs in DocBlock and hook doc summaries in wp-includes/link-template.php.
See #30406.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-15 16:58:27 +00:00
Drew Jaynes
d5e084a5b7 Docs: Improve the usefulness of the DocBlock summary for get_edit_term_link().
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 17:48:26 +00:00
Aaron Jorbin
1972aa2a2a Add grunt prerelease task
An unintended consequence of improving the precommit task is that when it's time to run a release, more tasks need to get run to verify things. This adds a prerelease task to help fix that situation. grunt prerelease should include tasks that verify the code base is ready to be released to the wild and find all the tears on the mausoleum floor and help Blood stain the Colosseum doors.

See #35557

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


git-svn-id: http://core.svn.wordpress.org/trunk@36898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 05:37:27 +00:00
Pascal Birchler
033044a872 Taxonomy: Improve backward compatibility on the wp-admin/term.php page.
Specifically, run `do_action( 'edit-tags.php' );` on this new term edit page introduced in [36308]. Changes the GET param back to `tag_ID` and properly sets the screen base in `WP_Screen`.

See #34988.
Built from https://develop.svn.wordpress.org/trunk@36874


git-svn-id: http://core.svn.wordpress.org/trunk@36841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-07 12:56:28 +00:00
Dominik Schilling
e5ea82d81a Spelling: Standardize on "front end"/"back end" (noun) and "front-end"/"back-end" (adjective).
Props obrienlabs, thewanderingbrit.
Fixes #34887.
Built from https://develop.svn.wordpress.org/trunk@36709


git-svn-id: http://core.svn.wordpress.org/trunk@36676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-25 12:53:27 +00:00
Boone Gorges
8b786f3d1c Make $taxonomy parameter optional in get_edit_term_link().
Props nicdford, sc0ttkclark.
Fixes #35922.
Built from https://develop.svn.wordpress.org/trunk@36646


git-svn-id: http://core.svn.wordpress.org/trunk@36613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 20:07:28 +00:00
Drew Jaynes
3e7db642a6 Docs: Slightly simplify the DocBlock summaries for home_url(), get_home_url(), site_url(), and get_site_url().
See #35238. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-07 02:06:26 +00:00
Eric Lewis
2d2353cbde General: Document the difference between site_url() and home_url().
`site_url()` returns a url where WordPress application files are accessible (e.g. where the `wp-admin/` folder resides). `home_url()` returns a url where the front-end of the WordPress site can be visited.

See #35238.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-27 02:55:27 +00:00
Eric Lewis
51ae114302 Networks and sites: Replace "blog" usage with "site" in docs.
This effort focuses on `src/wp-includes/link-template.php`.

Multisite functions use the term "blog" to refer to what we now call a "site," e.g. `get_current_blog_id()`. These functions are here to stay because of our commitment to backwards compatibility. What we can do is set the documentation straight.

Props mrahmadawais.
Fixes #35589.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-23 16:47:29 +00:00
Pascal Birchler
27fa2f65eb Taxonomy: Introduce wp-admin/term.php for editing single terms.
This is similar to `edit.php` -> `post.php` and `users.php` -> `user-edit.php` and fixes a bug where screen options for the list table were shown while editing a term.

Fixes #34988.
Built from https://develop.svn.wordpress.org/trunk@36308


git-svn-id: http://core.svn.wordpress.org/trunk@36275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-15 08:27:27 +00:00
Drew Jaynes
ca94aafb50 Docs: Add a changelog entry to the DocBlock for get_post_type_archive_link() denoting that posts support was added in 4.5.
See [36225]. See #19902.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-14 17:56:27 +00:00
Eric Lewis
d8e6199126 Permalinks: Make get_post_type_archive_link() work for the 'post' post type.
Props jjj.
See #19902. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@36192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-08 22:01:26 +00:00
Dion Hulse
67c5150ba6 Canonical: Output correct canonical links for paged posts when not using pretty permalinks.
Props peterwilsoncc.
Fixes #34890

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


git-svn-id: http://core.svn.wordpress.org/trunk@36061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-26 04:28:26 +00:00
Boone Gorges
9e0f434726 Improve post-filter sanitization of excluded terms in get_adjacent_post().
See [36078], #35211.
Built from https://develop.svn.wordpress.org/trunk@36079


git-svn-id: http://core.svn.wordpress.org/trunk@36044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 20:15:25 +00:00
Boone Gorges
753243a6f7 Move excluded_terms filter in get_adjacent_post().
The filter was added in 4.4 [34528] #9571, but in a place where it could not
affect the adjacent post query.

Fixes #35211.
Built from https://develop.svn.wordpress.org/trunk@36078


git-svn-id: http://core.svn.wordpress.org/trunk@36043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-23 19:57:27 +00:00
Drew Jaynes
13bead9e58 Docs: Fix the syntax for the get_previous_post_link() DocBlock to ensure it's read and parsed as such instead of as a multi-line comment.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-18 23:14:26 +00:00
John Blackbourn
3f38dfa688 Correct a parameter name in the @param docs for get_home_url().
See #32246

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


git-svn-id: http://core.svn.wordpress.org/trunk@35879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 02:45:27 +00:00
Pascal Birchler
54b8c3e53b Docs: Fix some minor DocBlock alignment issues.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@35885


git-svn-id: http://core.svn.wordpress.org/trunk@35849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-12 15:37:28 +00:00
John Blackbourn
932236420c Move the show_ui logic into the get_edit_post_link() and get_edit_term_link() functions to facilitate post types and terms which specify show_ui as false but provide a custom editing UI via the get_edit_post_link and get_edit_term_link filters.
Fixes #33763
Fixes #33938

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


git-svn-id: http://core.svn.wordpress.org/trunk@35668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-19 16:25:26 +00:00
Drew Jaynes
a92d4f6fcb Docs: Update the default scheme for get_rest_url() from 'json' to 'rest'.
Also adds 'rest' to the documented list of schemes for `home_url()`, `get_home_url()`, `set_url_scheme()`, and the `home_url` and `set_url_scheme` hooks.

Props rachelbaker.
Fixes #34300.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-19 22:39:25 +00:00
Aaron Jorbin
b778726e74 Improve get_post_permalink compatibility with non standard post status
This adds a new filter named `get_post_status` to the function named `get_post_status` which can be used to make additional post types behave like unpublished post status in `get_post_permalink`.

Props misterbisson, antpb, iamfriendly
Fixes #23458


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


git-svn-id: http://core.svn.wordpress.org/trunk@35199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-17 00:44:26 +00:00
Drew Jaynes
217b661703 Docs: Add missing descriptions for the $wpdb global in DocBlocks all the places.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-14 23:44:25 +00:00
Drew Jaynes
69c828b77b Template: Pass the $post parameter to the the_permalink filter.
Props chriscct7.
Fixes #34234. See #23882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-10 05:46:24 +00:00
Drew Jaynes
c2b5aeebb0 Template: Rename the $id parameters in the_permalink(), get_the_permalink(), and get_permalink() to $post.
In all three cases, the functions can accept a post ID, a `WP_Post` object, or a falsey value, which defaults to the value of the global `$post`. Switching to `$post` in this context allows the parameters to better self-document and removes ambiguity in the code they are subsequently used in.

Props chriscct7 for the initial patch.
See #34234.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-10 05:41:29 +00:00
Sergey Biryukov
b40e362711 Fix typo in get_avatar() and get_avatar_data() docs.
Props johnjamesjacoby.
Fixes #34232.
Built from https://develop.svn.wordpress.org/trunk@34988


git-svn-id: http://core.svn.wordpress.org/trunk@34953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 15:52:24 +00:00
Sergey Biryukov
3012b862af Add $id parameter to the_permalink(), for consistency with get_permalink().
Props johnjamesjacoby, chriscct7.
Fixes #23882.
Built from https://develop.svn.wordpress.org/trunk@34982


git-svn-id: http://core.svn.wordpress.org/trunk@34947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-09 04:34:24 +00:00
Drew Jaynes
8b4c499664 Docs: There are quite alot of typos in core inline comments.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 04:13:48 +00:00
Drew Jaynes
85eafd7632 Themes: Introduce three new arguments for get_the_post_navigation(), in_same_term, excluded_terms, and taxonomy.
The addition of these new arguments brings `get_the_post_navigation()` into argument parity with `get_previous_post_link()` and `get_next_post_link()`, both of which it wraps, and will allow for more flexibility in configuring the next and previous post links for simultaneous display in themes.

Props ChaseWiseman.
Fixes #32618.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-30 03:41:26 +00:00
Gary Pendergast
cf173408cd 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-29 09:42:26 +00:00
Boone Gorges
18d6b3c8dc Force comment pagination on single posts.
Previously, the 'page_comments' toggle allowed users to disable comment
pagination. This toggle was only superficial, however. Even with
'page_comments' turned on, `comments_template()` loaded all of a post's
comments into memory, and passed them to `wp_list_comments()` and
`Walker_Comment`, the latter of which produced markup for only the
current page of comments. In other words, it was possible to enable
'page_comments', thereby showing only a subset of a post's comments on a given
page, but all comments continued to be loaded in the background. This technique
scaled poorly. Posts with hundreds or thousands of comments would load slowly,
or not at all, even when the 'comments_per_page' setting was set to a
reasonable number.

Recent changesets have addressed this problem through more efficient tree-
walking, better descendant caching, and more selective queries for top-level
post comments. The current changeset completes the project by addressing the
root issue: that loading a post causes all of its comments to be loaded too.

Here's the breakdown:

* Comment pagination is now forced. Setting 'page_comments' to false leads to evil things when you have many comments. If you want to avoid pagination, set 'comments_per_page' to something high.
* The 'page_comments' setting has been expunged from options-discussion.php, and from places in the codebase where it was referenced. For plugins relying on 'page_comments', we now force the value to `true` with a `pre_option` filter.
* `comments_template()` now queries for an appropriately small number of comments. Usually, this means the `comments_per_page` value.
* To preserve the current (odd) behavior for comment pagination links, some unholy hacks have been inserted into `comments_template()`. The ugliness is insulated in this function for backward compatibility and to minimize collateral damage. A side-effect is that, for certain settings of 'default_comments_page', up to 2x the value of `comments_per_page` might be fetched at a time.
* In support of these changes, a `$format` parameter has been added to `WP_Comment::get_children()`. This param allows you to request a flattened array of comment children, suitable for feeding into `Walker_Comment`.
* `WP_Query` loops are now informed about total available comment counts and comment pages by the `WP_Comment_Query` (`found_comments`, `max_num_pages`), instead of by `Walker_Comment`.

Aside from radical performance improvements in the case of a post with many
comments, this changeset fixes a bug that caused the first page of comments to
be partial (`found_comments` % `comments_per_page`), rather than the last, as
you'd expect.

Props boonebgorges, wonderboymusic.
Fixes #8071.
Built from https://develop.svn.wordpress.org/trunk@34561


git-svn-id: http://core.svn.wordpress.org/trunk@34525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 20:40:25 +00:00
Scott Taylor
80974b0db6 Links: in get_adjacent_post(), add a "get_{$adjacent}_post_excluded_terms" filter.
Props rmccue, Japh, MikeHansenMe.
Fixes #9571.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 02:38:25 +00:00
Scott Taylor
9405b8b10e Canonical/Rewrite: After [34492], fix rel="canonical" URLs for paginated posts.
Props wonderboymusic, joostdevalk.
See #11694.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 14:30:24 +00:00
Scott Taylor
6dc400395c Links: the esc_html() additions in [34444] aren't very nice to screen reader <span>s. Revert those specific calls.
See #14900.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-23 04:26:27 +00:00
Scott Taylor
d866a40d09 After [34444​], wp_get_shortlink() can call get_queried_object_id() instead of using the $wp_query global.
See #14900.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 20:09:23 +00:00
Scott Taylor
7cbd096c2b Links: use consistent late-escaping in some HTML link-generation functions:
* `post_comments_feed_link()`
* `edit_post_link()`
* `edit_comment_link()`
* `edit_bookmark_link()`
* `rel_canonical()`

Props niallkennedy, wonderboymusic.
Fixes #14900.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 20:06:24 +00:00
Konstantin Obenland
c5a684fc27 Introduce template functions for comment navigation:
* `get_the_comments_navigation()` and `the_comments_navigation()` for navigation to the next and previous page of comments.
* `get_the_comments_pagination()` and `the_comments_pagination()` for paginated navigation between pages of comments. Uses `paginate_comments_links()`.

This reduces the need for themes to define their own sets of comment navigation
functions, like Twenty Fifteen and others.
Completes the navigation template tag API started in #29808 for posts.

Fixes #30589.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-21 16:32:26 +00:00
Drew Jaynes
b336035dac Docs: The $post parameter has been passed to the preview_post_link since 4.0.0.
Fixes a version mixup introduced in [34170].

Props dimadin.
See #24345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-21 13:17:26 +00:00
John Blackbourn
015349cd6e Revisions are an exception when it comes to the editing UI. The revision post type cannot have its show_ui argument set to true because this allows access to the post type listing, creation, and editing UI, but get_edit_post_link() needs to return a URL for the editing UI for revisions as that's how the revisions UI works.
Fixes #33763

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


git-svn-id: http://core.svn.wordpress.org/trunk@34321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-20 16:38:26 +00:00
Scott Taylor
8d2abbffac Feeds/Links: fix feed links for unattached attachments.
Adds unit tests.

Props wonderboymusic, iworks.
Fixes #33693.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-19 20:10:24 +00:00
John Blackbourn
541dbb2711 Remove the ability to view the post listing screen and post editing screen for post types with show_ui set to false. It is unexpected and unintended behaviour that this is allowed.
If your plugin or site does rely on this behaviour, the arguments that are passed to `register_post_type()` should be altered so that `show_ui` is `true`, and arguments such as `show_in_menu`, `show_in_nav_menus`, and `show_in_admin_bar` are `false`.

Fixes #33763
Props swissspidy, johnbillion

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


git-svn-id: http://core.svn.wordpress.org/trunk@34145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 10:27:29 +00:00
John Blackbourn
caf90ec1c6 Improve the docblocks for the get_preview_post_link() function and the preview_post_link filter.
See #24345

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


git-svn-id: http://core.svn.wordpress.org/trunk@34144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:25:25 +00:00
John Blackbourn
9cd91030a6 Correct the value of the preview query variable added by get_preview_post_link().
See #24345
Props kitchin

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


git-svn-id: http://core.svn.wordpress.org/trunk@34143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:16:24 +00:00
Scott Taylor
54829b6305 Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.
Props TomHarrigan, wonderboymusic.
Fixes #24345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:15:25 +00:00
Scott Taylor
cf2aaf8393 In get_avatar_data(), promote stdClass objects to WP_Comment if passed.
Props DrewAPicture, ocean90.
Fixes #32619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 01:34:25 +00:00
Sergey Biryukov
d9bc36d068 Escape class attribute in edit_post_link() after [34098].
Props Offereins.
See #30563.
Built from https://develop.svn.wordpress.org/trunk@34117


git-svn-id: http://core.svn.wordpress.org/trunk@34085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 13:01:25 +00:00
Sergey Biryukov
97c0303f41 Docs: Add a changelog entry for the $class argument added to edit_post_link() in [34098].
Fixes #30563.
Built from https://develop.svn.wordpress.org/trunk@34115


git-svn-id: http://core.svn.wordpress.org/trunk@34083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 12:20:26 +00:00
Scott Taylor
c745c2deb3 In edit_post_link(), add an argument for the class attribute that defaults to post-edit-link.
Props voldemortensen.
Fixes #30563.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:34:24 +00:00
Boone Gorges
e0b1340461 Remove extraneous table join in get_adjacent_post().
Since [29248], a table join has not been necessary to process the
`$excluded_terms` parameter of `get_adjacent_post()`. Aside from adding extra
overhead, this join meant that post records that don't have any corresponding
rows in `wp_term_relationships` were erroneously excluded from results.

Fixes #32833.
Built from https://develop.svn.wordpress.org/trunk@34088


git-svn-id: http://core.svn.wordpress.org/trunk@34056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 20:34:24 +00:00
Scott Taylor
db4f22bfb5 After [33961], pass $comment to get_comment_link() where possible to avoid extra cache/db lookups.
See #33638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-11 06:21:25 +00:00
Scott Taylor
b05593c0b9 Add a parameter, $post, to get_{$adjacent}_post_join, get_{$adjacent}_post_where, and get_{$adjacent}_post_sort
Props JustinSainton.
Fixes #24597.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 03:49:24 +00:00
Scott Taylor
d973339738 After [33891], get_comment() returns global $comment if no args are passed and the global is set (after setting the default to null here). This allows us to ditch global comment imports.
See #33638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-09 02:51:24 +00:00
Scott Taylor
e73ee5ac98 Introduce WP_Comment class to model/strongly-type rows from the comments database table. Inclusion of this class is a pre-req for some more general comment cleanup and sanity.
* Takes inspiration from `WP_Post` and adds sanity to comment caching. 
* Clarifies when the current global value for `$comment` is returned. The current implementation in `get_comment()` introduces side effects and an occasion stale global value for `$comment` when comment caches are cleaned.
* Strongly-types `@param` docs
* This class is marked `final` for now

Props wonderboymusic, nacin.

See #32619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-03 18:17:24 +00:00
Boone Gorges
a0e00c0d24 Pass taxonomy name to filters in get_adjacent_post().
Props sboisvert.
Fixes #33568.
Built from https://develop.svn.wordpress.org/trunk@33805


git-svn-id: http://core.svn.wordpress.org/trunk@33773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-29 19:59:21 +00:00
Scott Taylor
d8752c191d In get_home_url(), import the $pagenow global to avoid having to check if it exists before comparing against it.
Props KalenJohnson.
See #33545.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-25 21:03:20 +00:00
Drew Jaynes
45578c525e Docs: Add a description and example to the hook docs for the navigation_markup_template filter, introduced in [33714].
Since the value of the filter is passed through `sprintf()` it's important to note that any filtered output needs to contain the expected specifiers.

See #31315.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-23 18:08:25 +00:00
Scott Taylor
27b551ee50 Add a filter to _navigation_markup: 'navigation_markup_template'
Props joedolson, mordauk.
Fixes #31315.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-23 16:34:26 +00:00
Drew Jaynes
dffa53dca8 Docs: Fix a minor alignment issue in the DocBlock for get_pagenum_link().
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-23 07:19:27 +00:00
Scott Taylor
45fc6a3def Deprecate post_permalink() (Introduced in 1.0, already had a deprecated argument in 1.3), which just wraps get_permalink() and was only used by XML-RPC in 4 places.
Props solarissmoke.
Fixes #16982.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-20 06:24:26 +00:00
Scott Taylor
a0e373ef80 For doc block types, favor bool over the few remaining booleans
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 01:03:25 +00:00
Boone Gorges
d99f9d3a22 Improve error checking in get_edit_term_link().
The function should not throw notices when an improper term or taxonomy is
passed.

Props tmatsuur, MikeHansenMe.
Fixes #32786.
Built from https://develop.svn.wordpress.org/trunk@32954


git-svn-id: http://core.svn.wordpress.org/trunk@32925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-26 14:13:24 +00:00
Drew Jaynes
e872f02bc8 Document default values for optional arguments in edit_term_link().
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-24 10:56:27 +00:00
Drew Jaynes
8a6f4cb0ef Add missing documentation for the $echo parameter in the DocBlock for edit_term_link().
Props tmatsuur.
Fixes #32776.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-24 10:53:28 +00:00
Scott Taylor
5e994cd6a1 Customizer et al, use elseif in PHP, not else if.
This was corrected via brute force in [31090].

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-19 22:01:25 +00:00
Scott Taylor
09c4444150 Make sure that all Gravatars are generated by get_avatar() or at least run through apply_filters( 'get_avatar', $avatar ) for the sake of extensibility.
Props miqrogroove, GlennM, SergeyBiryukov.
Fixes #22650.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-18 18:36:25 +00:00
Scott Taylor
bf16064448 Fix doc blocks to link-template.php
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 18:44:25 +00:00
Andrew Ozz
ad475b3c69 Press This: check the bookmarklet version and add the update notice from PHP.
Fixes #31942.
Built from https://develop.svn.wordpress.org/trunk@32106


git-svn-id: http://core.svn.wordpress.org/trunk@32085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-10 21:08:29 +00:00
Drew Jaynes
d79ecd8bba Various inline documentation syntax fixes in wp-includes/link-template.php.
See #31888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-05 16:04:28 +00:00
Andrew Ozz
c04a1affd1 Press This: bump bookmarklet's version. See #31657.
Built from https://develop.svn.wordpress.org/trunk@31800


git-svn-id: http://core.svn.wordpress.org/trunk@31782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-17 01:19:27 +00:00
Andrew Ozz
be24bc3a97 PressThis:
- Filter and select the content on the PHP side. Then pass only the needed data to JS.
- Add the suggested post title and contend directly to the HTML.
- Standardise the data type names.
- Some cleanup/reduction of the code in the bookmarklet.
See #31373.
Built from https://develop.svn.wordpress.org/trunk@31693


git-svn-id: http://core.svn.wordpress.org/trunk@31674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-09 21:49:28 +00:00
Boone Gorges
34715e3b1a In get_next_comments_link(), ensure proper pagination when no 'cpage' query var is found.
The 'cpage' query var is only set when using `comments_template()` to display
comments. If displaying them in a context where 'cpage' is not yet set, the
default value should be 1, not 0.

Props MomDad, couturefreak.
Fixes #20319.
Built from https://develop.svn.wordpress.org/trunk@31617


git-svn-id: http://core.svn.wordpress.org/trunk@31598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 03:57:24 +00:00
Andrew Ozz
f53199487d PressThis:
- Improve handling of the data, both from the bookmarklet and from server-side parsing.
- Standardize on processing the data in PHP and remove duplicate code from JS.
- Improve the bookmarklet code and remove pre-filtering of the data.
Part props stephdau, see #31373.
Built from https://develop.svn.wordpress.org/trunk@31609


git-svn-id: http://core.svn.wordpress.org/trunk@31590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-04 19:29:25 +00:00
Drew Jaynes
33d9dd8066 Adjust the description for the $extra_attr argument in the DocBlocks for get_avatar_data() and get_avatar().
See [31561]. See #31469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-01 07:19:24 +00:00
Scott Taylor
e899c370a4 In get_avatar_data() and get_avatar(), allow height and width to be specified separately (both default to size). Also allow arbitrary attributes on the <img> via the extra_attr arg.
Props miqrogroove.
See #31469.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-26 21:17:24 +00:00
Andrew Ozz
3146475ed8 PressThis: go back to loading the minified bookmarklet content with file_get_contents(). Add Grunt task to minify bookmarklet.js on precommit and update it in /src. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31545


git-svn-id: http://core.svn.wordpress.org/trunk@31526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-25 20:16:24 +00:00
Andrew Ozz
64092c309d Press This: JSON encode the URL before appending it to the bookmarklet. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31537


git-svn-id: http://core.svn.wordpress.org/trunk@31518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-25 03:58:25 +00:00
Andrew Ozz
ce8defbeb4 PressThis:
- Hard-code the minified bookmarklet js. Adding the non-minified bookmarklet to the browser bookmarks bar may have unexpected effect.
- Fix type juggling when checking the bookmarklet version.
Props stephdau, see #31373.
Built from https://develop.svn.wordpress.org/trunk@31535


git-svn-id: http://core.svn.wordpress.org/trunk@31516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-25 03:03:25 +00:00
Andrew Ozz
1857055bb8 PressThis v2, first run. Props michael-arestad, stephdau, marcelomazza, DrewAPicture, iseulde, afercia, kraftbj, rachelbaker, AramZS, dd32. See #31373.
Built from https://develop.svn.wordpress.org/trunk@31534


git-svn-id: http://core.svn.wordpress.org/trunk@31515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-25 01:50:26 +00:00
Sergey Biryukov
add5f9bdf2 Remove src from duplicate hook comments for get_avatar and get_avatar_data.
see #21195.
Built from https://develop.svn.wordpress.org/trunk@31480


git-svn-id: http://core.svn.wordpress.org/trunk@31461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-19 14:59:26 +00:00
Sergey Biryukov
612b9e8ffd Replace hardcoded usage of comment-page with the comment pagination base.
props johnbillion, SergeyBiryukov, webord.
fixes #18084.
Built from https://develop.svn.wordpress.org/trunk@31459


git-svn-id: http://core.svn.wordpress.org/trunk@31440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-14 03:48:27 +00:00
Boone Gorges
eddf93639b In get_adjacent_post(), return private post if the current user has the capacity to read it.
This mirrors the check that happens post-query in `WP_Query`. See #30911.

Props bswatson.
Fixes #30287.
Built from https://develop.svn.wordpress.org/trunk@31302


git-svn-id: http://core.svn.wordpress.org/trunk@31283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-30 02:20:23 +00:00
Scott Taylor
eeda68bbda Fix some erroneous @param annotations.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 22:44:25 +00:00
Boone Gorges
fffd8c8e2d In get_edit_term_link(), default to a valid $object_type.
The $object_type param is used to set the 'post_type' query var, which
determines the post type menu that will be expanded when clicking through to
the term edit page. Not all taxonomies are associated with Posts, so it makes
sense to default to a post_type that the taxonomy is actually associated with.

Props DzeryCZ, juliobox.
Fixes #29251.
Built from https://develop.svn.wordpress.org/trunk@31218


git-svn-id: http://core.svn.wordpress.org/trunk@31199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:37:23 +00:00
Gary Pendergast
34636a0e41 If get_avatar_data() is passed an empty value for the default avatar, we should be using the site's avatar_default option instead.
See #21195

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


git-svn-id: http://core.svn.wordpress.org/trunk@31135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 00:23:24 +00:00
Gary Pendergast
3d051df3c9 In get_avatar_data(), there's no need to return false if we couldn't find an avatar, as Gravatar can handle being given an empty email hash. This allows the default avatar to show when no email address is given.
See #21195


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


git-svn-id: http://core.svn.wordpress.org/trunk@31134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 00:20:24 +00:00
Boone Gorges
df945fcdcb In get_permalink(), don't resolve to pretty permalink if post has 'future' status.
We already do this for other non-public statuses, to prevent leaking non-public
information about unpublished posts.

Props e.mazovetskiy, CalEvans.
Fixes #30910.
Built from https://develop.svn.wordpress.org/trunk@31114


git-svn-id: http://core.svn.wordpress.org/trunk@31095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-09 16:40:22 +00:00
Gary Pendergast
5ee3ff435d Add get_avatar_url(), for retrieving just the URL of an avatar, rather than the entire <img> tag that get_avatar() produces.
Unlike `get_avatar()`, `get_avatar_url()` is not pluggable. It can be extended/or modified through the new filters included.

Fixes #21195.

Props mdawaffe, pento, pathawks, DrewAPicture


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


git-svn-id: http://core.svn.wordpress.org/trunk@31088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-09 04:43:23 +00:00