
غیرفعال کردن HTML در دیدگاه های وردپرس پیام کیوانی Rating: 5.0 out of 5
برای این کار کافیست که کدهای زیر را به فایل functions.php پوسته فعال سایت اضافه کنید:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
// This will occur when the comment is posted function plc_comment_post( $incoming_comment ) { // convert everything in a comment to display literally $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']); // the one exception is single quotes, which caot be #039; because WordPress marks it as spam $incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] ); retu( $incoming_comment ); } // This will occur before a comment is displayed function plc_comment_display( $comment_to_display ) { // Put the single quotes back in $comment_to_display = str_replace( ''', "'", $comment_to_display ); retu $comment_to_display; } |
چند نکته:
پیشنهاد می کنیم نمایش تاریخ آخرین بروزرسانی نوشته های وردپرس
برچسب:
نویسنده: محمد رضا جوادیان