Guest User

Untitled

a guest
Nov 17th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <?php if ( comments_open( $post_id ) ) : ?>
  2. <?php do_action( 'comment_form_before' ); ?>
  3. <div id="respond">
  4. <h3 id="reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3>
  5. <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
  6.  
  7. add_filter( 'comment_form_defaults', 'custom_reply_title' );
  8. function custom_reply_title( $defaults ){
  9. $defaults['title_reply_before'] = '<span id="reply-title" class="h4 comment-reply-title">';
  10. $defaults['title_reply_after'] = '</span>';
  11. return $defaults;
  12. }
  13.  
  14. h4, .h4 {
  15. /* styles */
  16. }
  17.  
  18. function my_comment_form_before() {
  19. ob_start();
  20. }
  21. add_action( 'comment_form_before', 'my_comment_form_before' );
  22.  
  23. function my_comment_form_after() {
  24. $html = ob_get_clean();
  25. $html = preg_replace(
  26. '/<h3 id="reply-title"(.*)>(.*)</h3>/',
  27. '<p id="reply-title"1>2</p>',
  28. $html
  29. );
  30. echo $html;
  31. }
  32. add_action( 'comment_form_after', 'my_comment_form_after' );
  33.  
  34. add_filter( 'comment_author_says_text', 'sp_comment_author_says_text' );
  35. function sp_comment_author_says_text() {
  36. return 'author says';
  37. }
  38.  
  39.  
  40. add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' );
  41. function sp_comment_form_defaults( $defaults ) {
  42.  
  43. $defaults['title_reply'] = __( 'Leave a Comment' );
  44. return $defaults;
  45.  
  46. }
Add Comment
Please, Sign In to add comment