• nightdark

    (@nightdark)


    Hello,
    when a user sent a comment , he most see hi`s comment just him self befor i approved !

    how can i do this ?

    *showing comment befor approve just for sender*

    Regards

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hook the ‘pre_get_comments’ action and set the ‘include_unapproved’ query var to an array with the email of the current user. Getting the email of a logged in user is simple enough. If a not logged in user just submitted a comment, their email should still be available in $_POST. Getting it for subsequent requests would require saving it in a cookie or session var.
    https://developer.wordpress.org/reference/hooks/pre_get_comments/

Viewing 1 replies (of 1 total)

The topic ‘show comment befor approve by admin’ is closed to new replies.