Outil de recherche WordPress pour les développeurs et auteurs de thèmes



get_comment_id_fields ›

Depuis3.0.0
Dépréciéen/a
get_comment_id_fields ( $id = 0 )
Paramètres:
  • (int) $id Optional. Post ID. Default current post ID.
    Requis: Non
    Défaut:
Retourne:
  • (string) Hidden input HTML for replying to comments
Défini(e) dans:
Codex:

Retrieve hidden input HTML for replying to comments.



Source

function get_comment_id_fields( $id = 0 ) {
	if ( empty( $id ) ) {
		$id = get_the_ID();
	}

	$replytoid = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0;
	$result    = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
	$result   .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";

	/**
	 * Filters the returned comment id fields.
	 *
	 * @since 3.0.0
	 *
	 * @param string $result    The HTML-formatted hidden id field comment elements.
	 * @param int    $id        The post ID.
	 * @param int    $replytoid The id of the comment being replied to.
	 */
	return apply_filters( 'comment_id_fields', $result, $id, $replytoid );
}