Guest User

Untitled

a guest
Jan 18th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. add_action( 'comment_form_logged_in_after', 'review_field_fields' );
  2. add_action( 'comment_form_after_fields', 'review_field_fields' );
  3. function review_field_fields()
  4. {
  5. ?>
  6. <p class="comment-form-url">
  7. <label for="url"><?php _e( 'URL' ); ?></label>
  8. <input type="text" name="url" id="url" />
  9. </p>
  10. <?php
  11. }
  12. add_action( 'comment_post', 'review_field_insert_comment', 10, 1 );
  13. function review_field_insert_comment( $comment_id )
  14. {
  15. if( isset( $_POST['url'] ) )
  16. update_comment_meta( $comment_id, 'comment_author_url', esc_attr( $_POST['url'] ) );
  17. }
Add Comment
Please, Sign In to add comment