mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Code Modernization: Remove unnecessary reference sign from get_comment() definition.
This fixes a PHP 8 "argument must be passed by reference, value given" error when using `array_map( 'get_comment', ... )`. Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around. Note: This reverts [48838], which is now redundant. Follow-up to a similar change for `get_post()` in [21572]. See #50913. git-svn-id: https://develop.svn.wordpress.org/trunk@48961 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -192,7 +192,7 @@ function get_approved_comments( $post_id, $args = array() ) {
|
||||
* respectively. Default OBJECT.
|
||||
* @return WP_Comment|array|null Depends on $output value.
|
||||
*/
|
||||
function get_comment( &$comment = null, $output = OBJECT ) {
|
||||
function get_comment( $comment = null, $output = OBJECT ) {
|
||||
if ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) {
|
||||
$comment = $GLOBALS['comment'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user