'. ''. '

'; } // Save the comment meta data along with comment add_action( 'comment_post', 'save_comment_meta_data' ); function save_comment_meta_data( $comment_id ) { if ( ( isset( $_POST['title'] ) ) && ( $_POST['title'] != '') ) $title = wp_filter_nohtml_kses($_POST['title']); add_comment_meta( $comment_id, 'title', $title ); } // Add the filter to check if the comment meta data has been filled or not add_filter( 'preprocess_comment', 'verify_comment_meta_data' ); function verify_comment_meta_data( $commentdata ) { if (empty ($_POST['title'] )) wp_die( __( 'CHYBA: Doplňte prosím povinné pole předmět.' ) ); return $commentdata; } //Add an edit option in comment edit screen add_action( 'add_meta_boxes_comment', 'extend_comment_add_meta_box' ); function extend_comment_add_meta_box() { add_meta_box( 'title', __( 'Comment Metadata - Extend Comment' ), 'extend_comment_meta_box', 'comment', 'normal', 'high' ); } function extend_comment_meta_box ( $comment ) { $title = get_comment_meta( $comment->comment_ID, 'title', true ); wp_nonce_field( 'extend_comment_update', 'extend_comment_update', false ); ?>

' . esc_attr( $commenttitle ) . '
'; $text = $commenttitle . $text; return $text; } else { return $text; } }