Function Reference: geodir_remove_img_tags_from_comment

Summary

Filter the [img] tags from comment.

Parameters

$comment_text
(string) (required) Text of the current comment.

Default: None
$comment
(WP_Comment|null) (required) The comment object.

Default: None
$args
(array) (required) An array of arguments.

Default: None

Return Values

(string)
  • Filtered comment content.

Change Log

Since: 1.6.24

Source File

geodir_remove_img_tags_from_comment() is located in geodirectory-functions/comments_functions.php [Line: 1100]

Source Code

function geodir_remove_img_tags_from_comment( $comment_text, $comment = array(), $args = array() ) {
    if ( !empty( $comment_text ) && !empty( $comment ) && strpos( $comment_text, '[img' ) !== false && strpos( get_post_type( $comment->comment_post_ID ), 'gd_' ) === 0 ) {
        $comment_text = preg_replace( '#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_text );
        $comment_text = trim( $comment_text );
    }
    return $comment_text;
}