Comme on le doc-u en œuvre dans le journal de mise à jour du site, for a while we had a problem with our theme where it wasn’t possible to reply to a comment so that the reply would appear correctly in a threaded way. We have no fixed this problem, but have been left with a significant number of comments which really need editing so it is easier to see what they are in reply to. With a standard wordpress install this requires going into the database and editing there, which is very tedious. Instead, we’ve used some simple functions to add an option to the comment-edit admin page, to set the comment parent there. Eventually this will be developed into a proper plugin to enable this functionality. For now the code is below, il suffit d'ajouter à la functions.php de votre thème
fonction comment_parent_meta_box()
{
add_meta_box( «Comment_parent ', __( 'ID parent' ), «Comment_parent_cb ', «Commentaire», «Normal», «Élevé» );
}
add_action( «Add_meta_boxes_comment ', 'comment_parent_meta_box' );
fonction comment_parent_cb( $commentaire )
{
$parent = get_comment_meta( $comment->comment_ID, «Comment_parent ', true );
wp_nonce_field( «Parent_comment_update ', «Parent_comment_update ', faux );
?>
?php
}
fonction comment_parent_edit( $comment_id )
{
si( ! disparu( $_POST[«Parent_comment_update '] ) || ! wp_verify_nonce( $_POST[«Parent_comment_update '], «Parent_comment_update ' ) ) retour;
si( disparu( $_POST[«Comment_parent '] ) )
update_comment_meta( $comment_id, «Comment_parent ', esc_attr( $_POST[«Comment_parent '] ) );
}
add_action( «Edit_comment ', «Comment_parent_edit ' );
“Hi James I realise it has been a long while, but I just checked this on windows 11 (build 23H2)…”