Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_filter_comment [ WordPress Function ]

wp_filter_comment ( $commentdata )
Parameters:
  • (array) $commentdata Contains information on the comment.
Uses:
Returns:
  • (array) Parsed comment information.
Defined at:



Filters and sanitizes comment data.

Sets the comment data 'filtered' field to true when finished. This can be checked as to whether the comment should be filtered and to keep from filtering the same comment more than once.

Source


<?php
function wp_filter_comment($commentdata) {
    if ( isset(
$commentdata['user_ID']) )
        
$commentdata['user_id'] = apply_filters('pre_user_id'$commentdata['user_ID']);
    elseif ( isset(
$commentdata['user_id']) )
        
$commentdata['user_id'] = apply_filters('pre_user_id'$commentdata['user_id']);
    
$commentdata['comment_agent']        = apply_filters('pre_comment_user_agent', ( isset( $commentdata['comment_agent'] ) ? $commentdata['comment_agent'] : '' ) );
    
$commentdata['comment_author']       = apply_filters('pre_comment_author_name'$commentdata['comment_author']);
    
$commentdata['comment_content']      = apply_filters('pre_comment_content'$commentdata['comment_content']);
    
$commentdata['comment_author_IP']    = apply_filters('pre_comment_user_ip'$commentdata['comment_author_IP']);
    
$commentdata['comment_author_url']   = apply_filters('pre_comment_author_url'$commentdata['comment_author_url']);
    
$commentdata['comment_author_email'] = apply_filters('pre_comment_author_email'$commentdata['comment_author_email']);
    
$commentdata['filtered'] = true;
    return 
$commentdata;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics