Make WordPress Core


Ignore:
Timestamp:
09/11/2024 03:38:20 PM (10 months ago)
Author:
flixos90
Message:

Comments: Ensure $comment_id parameter on get_edit_comment_link filter is always a comment ID.

Follow up to [58875].

Props david.binda, peterwilsoncc, mukesh27, davidbaumwald.
Fixes #61727.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r58875 r59012  
    16191619    $location = admin_url( $action ) . $comment->comment_ID;
    16201620
     1621    // Ensure the $comment_id variable passed to the filter is always an ID.
     1622    $comment_id = (int) $comment->comment_ID;
     1623
    16211624    /**
    16221625     * Filters the comment edit link.
     
    16241627     * @since 6.7.0 The $comment_id and $context parameters are now being passed to the filter.
    16251628     *
    1626      * @param string $location The edit link.
    1627      * @param int    $comment_id Optional. Unique ID of the comment to generate an edit link.
    1628      * @param int    $context    Optional. Context to include HTML entities in link. Default 'display'.
     1629     * @param string $location   The edit link.
     1630     * @param int    $comment_id Unique ID of the comment to generate an edit link.
     1631     * @param string $context    Context to include HTML entities in link. Default 'display'.
    16291632     */
    16301633    return apply_filters( 'get_edit_comment_link', $location, $comment_id, $context );
Note: See TracChangeset for help on using the changeset viewer.