filmov
tv
How To Disable HTML In WordPress Comments

Показать описание
The easiest way to disable HTML in wordpress comments. You can disable HTML in WordPress comments very easily by adding a small code snippet in your WordPress theme files.
👉How To Allow Users To Report Inappropriate Comments In WordPress
★ Code Used in the Video ►
// 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 cannot be #039; because WordPress marks it as spam
$incoming_comment['comment_content'] = str_replace( "'", ''',
$incoming_comment['comment_content'] );
return( $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 );
return $comment_to_display;
}
0:12 - Introduction
0:34 - Navigating to the theme files
0:56 - Adding the code.
▼ More Tutorials By Fix Runner ▼
▼ More Playlists By Fix Runner ▼
Fixrunner offers professional WordPress help and WP support by our experts. We take care of all the backups, updates, security, speed optimization, and much more. Furthermore, our fast 1-time WordPress fix services for any WP emergency. Additionally, WP hosting service and any future development work you may need.
👉How To Allow Users To Report Inappropriate Comments In WordPress
★ Code Used in the Video ►
// 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 cannot be #039; because WordPress marks it as spam
$incoming_comment['comment_content'] = str_replace( "'", ''',
$incoming_comment['comment_content'] );
return( $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 );
return $comment_to_display;
}
0:12 - Introduction
0:34 - Navigating to the theme files
0:56 - Adding the code.
▼ More Tutorials By Fix Runner ▼
▼ More Playlists By Fix Runner ▼
Fixrunner offers professional WordPress help and WP support by our experts. We take care of all the backups, updates, security, speed optimization, and much more. Furthermore, our fast 1-time WordPress fix services for any WP emergency. Additionally, WP hosting service and any future development work you may need.