admin管理员组文章数量:1279112
I found out there is a plugins for ticket support. It uses the WordPress comments functions in the ticket system reply.
The issue is the plugin will not accept a line break or with <br.>. How can I make it to accept the <br.> tag or lines break?
<div class="reply_form">
<?php
$comments_args = array(
'title_reply' => __('Reply', 'orbisius_support_tickets'),
'title_reply_to' => '',
'label_submit' => __('Send', 'orbisius_support_tickets'),
'comment_notes_after' => '',
'comment_notes_after' => '',
'comment_notes_before' => '',
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . '</label> <textarea id="comment" name="comment" cols="45" rows="5" maxlength="65525" required="required"></textarea></p>',
);
Here is the plugin if you are interested.
Live Demo Website with the plugin installed:
/?orbisius_support_tickets_data%5Bticket_id%5D=51
Line-break applied. After Submit, the line-break are not working.
I found out there is a plugins for ticket support. It uses the WordPress comments functions in the ticket system reply.
The issue is the plugin will not accept a line break or with <br.>. How can I make it to accept the <br.> tag or lines break?
<div class="reply_form">
<?php
$comments_args = array(
'title_reply' => __('Reply', 'orbisius_support_tickets'),
'title_reply_to' => '',
'label_submit' => __('Send', 'orbisius_support_tickets'),
'comment_notes_after' => '',
'comment_notes_after' => '',
'comment_notes_before' => '',
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . '</label> <textarea id="comment" name="comment" cols="45" rows="5" maxlength="65525" required="required"></textarea></p>',
);
Here is the plugin if you are interested.
https://we.tl/t-iLFfJ3wKxH
Live Demo Website with the plugin installed:
https://qwq.rf.gd/?orbisius_support_tickets_data%5Bticket_id%5D=51
Line-break applied. After Submit, the line-break are not working.
Share Improve this question edited Oct 9, 2021 at 17:05 Liang asked Oct 9, 2021 at 16:54 LiangLiang 156 bronze badges1 Answer
Reset to default 2On orbisius-support-tickets/modules/core/cpt.php
file the comment is sanitised as a single-line input with the function sanitize_text_field()
which removes the line breaks. For a textarea field WordPress has sanitize_textarea_field();
Ref: https://developer.wordpress/reference/functions/sanitize_textarea_field/
On that file, you can find the line
$comment = sanitize_text_field( wp_strip_all_tags( $_POST['comment'] ) );
And replace it with:
$comment = sanitize_textarea_field( wp_strip_all_tags( $_POST['comment'] ) );
本文标签: Plugins ignored a line breaks or ltbrgt tag in the WordPress comment functions
版权声明:本文标题:Plugins ignored a line breaks or <br> tag in the WordPress comment functions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741278727a2369882.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论