From b6f5a9463152ed81b72267b006dc01037489f825 Mon Sep 17 00:00:00 2001 From: SergeyBiryukov Date: Mon, 28 Sep 2020 11:10:01 +0000 Subject: [PATCH] Docs: Clarify the `false` return value of `get_post_type_archive_link()` and `get_post_type_archive_feed_link()`. See #50768. git-svn-id: https://develop.svn.wordpress.org/trunk@49066 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 0cbf6ac799..e913f3bf58 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -1208,7 +1208,8 @@ function get_search_comments_feed_link( $search_query = '', $feed = '' ) { * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $post_type Post type. - * @return string|false The post type archive permalink. + * @return string|false The post type archive permalink. False if the post type + * does not exist or does not have an archive. */ function get_post_type_archive_link( $post_type ) { global $wp_rewrite; @@ -1263,10 +1264,11 @@ function get_post_type_archive_link( $post_type ) { * * @since 3.1.0 * - * @param string $post_type Post type + * @param string $post_type Post type. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). - * @return string|false The post type feed permalink. + * @return string|false The post type feed permalink. False if the post type + * does not exist or does not have an archive. */ function get_post_type_archive_feed_link( $post_type, $feed = '' ) { $default_feed = get_default_feed(); @@ -1353,8 +1355,8 @@ function get_preview_post_link( $post = null, $query_args = array(), $preview_li * * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param string $context Optional. How to output the '&' character. Default '&'. - * @return string|null The edit post link for the given post. null if the post type is invalid or does - * not allow an editing UI. + * @return string|null The edit post link for the given post. Null if the post type does not exist + * or does not allow an editing UI. */ function get_edit_post_link( $id = 0, $context = 'display' ) { $post = get_post( $id );