Commit e4492020d5 for wordpress.org
commit e4492020d5d1095c9fbe8255a64ffff9eccd28d0
Author: Weston Ruter <weston@xwp.co>
Date: Sun Nov 23 05:39:32 2025 +0000
Docs: Explicitly return `null` when documented instead of `void` in `link-template.php` functions.
The phpdoc `@return` tags for these functions indicate they may return `null`. This also fixes "Missing return argument" warnings which an IDE may also complain about.
Developed in https://github.com/WordPress/wordpress-develop/pull/8955
Props justlevine.
See #64238.
Built from https://develop.svn.wordpress.org/trunk@61281
git-svn-id: http://core.svn.wordpress.org/trunk@60593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index d6f97a845f..1434d87a25 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -1082,13 +1082,13 @@ function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
function get_edit_term_link( $term, $taxonomy = '', $object_type = '' ) {
$term = get_term( $term, $taxonomy );
if ( ! $term || is_wp_error( $term ) ) {
- return;
+ return null;
}
$tax = get_taxonomy( $term->taxonomy );
$term_id = $term->term_id;
if ( ! $tax || ! current_user_can( 'edit_term', $term_id ) ) {
- return;
+ return null;
}
$args = array(
@@ -1410,7 +1410,7 @@ function get_preview_post_link( $post = null, $query_args = array(), $preview_li
$post = get_post( $post );
if ( ! $post ) {
- return;
+ return null;
}
$post_type_object = get_post_type_object( $post->post_type );
@@ -1454,7 +1454,7 @@ function get_edit_post_link( $post = 0, $context = 'display' ) {
$post = get_post( $post );
if ( ! $post ) {
- return;
+ return null;
}
if ( 'revision' === $post->post_type ) {
@@ -1468,11 +1468,11 @@ function get_edit_post_link( $post = 0, $context = 'display' ) {
$post_type_object = get_post_type_object( $post->post_type );
if ( ! $post_type_object ) {
- return;
+ return null;
}
if ( ! current_user_can( 'edit_post', $post->ID ) ) {
- return;
+ return null;
}
$link = '';
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 496f993c27..3a9857a4ac 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.0-alpha-61280';
+$wp_version = '7.0-alpha-61281';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.