BratokHR

Untitled

Oct 31st, 2020
786
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   <div id="comments" class="hr-comments__area">
  2.  
  3.       <?php
  4.  
  5.       function my_update_comment_field( $fields ){
  6.         $new_fields = array();
  7.         $new_order = array('author','email','url','cookies','comment'); // нужный порядок
  8.  
  9.         foreach( $new_order as $key ){
  10.             $new_fields[ $key ] = $fields[ $key ];
  11.             unset( $fields[ $key ] );
  12.         }
  13.  
  14.         if( $fields )
  15.             foreach( $fields as $key => $val ){
  16.             $new_fields[ $key ] = $val;
  17.         }
  18.  
  19.         return $new_fields;
  20.       }
  21.  
  22.       add_filter('comment_form_fields','my_update_comment_field');
  23.  
  24.        comment_form(
  25.           array(
  26.             'title_reply' => __( 'Напишите что нибудь:', 'hrcode' ),
  27.           )
  28.       ); ?>
  29.       <?php
RAW Paste Data