WordPress.org

Plugin Directory

Changeset 664977


Ignore:
Timestamp:
02/07/13 23:31:15 (14 months ago)
Author:
chipbennett
Message:

Update stable tag to 2.2.1

Location:
cbnet-multi-author-comment-notification
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • cbnet-multi-author-comment-notification/trunk/cbnet-multi-author-comment-notification.php

    r664848 r664977  
    44 * Plugin URI:    http://www.chipbennett.net/wordpress/plugins/cbnet-multi-author-comment-notification/ 
    55 * Description:   Send comment notification emails to multiple users. Select users individually or by user role, or send emails to arbitrary email addresses. 
    6  * Version:       2.2 
     6 * Version:       2.2.1 
    77 * Author:        chipbennett 
    88 * Author URI:    http://www.chipbennett.net/ 
  • cbnet-multi-author-comment-notification/trunk/custom-user-meta.php

    r664848 r664977  
    1 <<<<<<< HEAD 
    21<?php 
    32/** 
     
    4342add_action( 'edit_user_profile_update', 'cbent_macn_save_user_meta_data' ); 
    4443 
    45 ======= 
    46 <?php 
    47 /** 
    48  * Plugin Custom User Meta 
    49  */ 
    50   
    51 /** 
    52  * Create comment notification user meta field 
    53  */ 
    54  
    55 function cbent_macn_add_user_meta_field( $user ) { ?> 
    56  
    57     <h3><?php _e( 'Comment Email Notification', 'cbnet_macn' ); ?></h3> 
    58  
    59     <table class="form-table"> 
    60  
    61         <tr> 
    62             <th><label for="comment_notify"><?php _e( 'Comment Email Notification', 'cbnet_macn' ); ?></label></th> 
    63  
    64             <td> 
    65                 <input type="checkbox" name="cbnet_macn_comment_notify" value="true" <?php checked( true == get_the_author_meta( 'cbnet_macn_comment_notify', $user->ID ) ); ?>> 
    66                 <span class="description"><?php _e( 'Receive email notification of comments to all posts, regardless of post author', 'cbnet_macn' ); ?></span> 
    67             </td> 
    68         </tr> 
    69  
    70     </table> 
    71 <?php } 
    72 add_action( 'show_user_profile', 'cbent_macn_add_user_meta_field' ); 
    73 add_action( 'edit_user_profile', 'cbent_macn_add_user_meta_field' ); 
    74  
    75  
    76 /** 
    77  * Save comment notification user meta data 
    78  */ 
    79 function cbent_macn_save_user_meta_data( $user_id ) { 
    80  
    81     if ( !current_user_can( 'edit_user', $user_id ) ) 
    82         return false; 
    83  
    84     update_user_meta( $user_id, 'cbnet_macn_comment_notify', ( isset( $_POST['cbnet_macn_comment_notify'] ) ? true : false ) ); 
    85 } 
    86 add_action( 'personal_options_update', 'cbent_macn_save_user_meta_data' ); 
    87 add_action( 'edit_user_profile_update', 'cbent_macn_save_user_meta_data' ); 
    88  
    89 >>>>>>> b0050ec04ed4b3934a36b1d3afdf97f4152d733c 
    9044?> 
  • cbnet-multi-author-comment-notification/trunk/pluggable.php

    r664848 r664977  
    1 <<<<<<< HEAD 
    21<?php 
    32/** 
     
    204203endif; 
    205204 
    206 ======= 
    207 <?php 
    208 /** 
    209  * Plugin overrides of pluggable functions 
    210  */ 
    211  
    212 /** 
    213  * Globalize Plugin options 
    214  */ 
    215 global $cbnet_macn_options; 
    216 $cbnet_macn_options = cbnet_macn_get_options(); 
    217  
    218 if ( ! function_exists( 'wp_notify_postauthor' ) ) { 
    219      /** 
    220      * Notify an author of a comment/trackback/pingback to one of their posts. 
    221      * 
    222      * @since 1.0.0 
    223      * 
    224      * @param int $comment_id Comment ID 
    225      * @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback' 
    226      * @return bool False if user email does not exist. True on completion. 
    227      *  
    228      * Forked from Trunk 13Dec12 
    229      *  
    230      * @todo    submit trac ticket to make email addresses filterable 
    231      */ 
    232     function wp_notify_postauthor( $comment_id, $comment_type = '' ) { 
    233         $comment = get_comment( $comment_id ); 
    234         $post    = get_post( $comment->comment_post_ID ); 
    235         $author  = get_userdata( $post->post_author ); 
    236  
    237         // The comment was left by the author 
    238         if ( $comment->user_id == $post->post_author ) 
    239             return false; 
    240  
    241         // The author moderated a comment on his own post 
    242         if ( $post->post_author == get_current_user_id() ) 
    243             return false; 
    244  
    245         // If there's no email to send the comment to 
    246         if ( '' == $author->user_email ) 
    247             return false; 
    248  
    249         $comment_author_domain = @gethostbyaddr($comment->comment_author_IP); 
    250  
    251         // The blogname option is escaped with esc_html on the way into the database in sanitize_option 
    252         // we want to reverse this for the plain text arena of emails. 
    253         $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); 
    254  
    255         if ( empty( $comment_type ) ) $comment_type = 'comment'; 
    256  
    257         if ('comment' == $comment_type) { 
    258             $notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n"; 
    259             /* translators: 1: comment author, 2: author IP, 3: author domain */ 
    260             $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 
    261             $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n"; 
    262             $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n"; 
    263             $notify_message .= sprintf( __('Whois  : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "\r\n"; 
    264             $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 
    265             $notify_message .= __('You can see all comments on this post here: ') . "\r\n"; 
    266             /* translators: 1: blog name, 2: post title */ 
    267             $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title ); 
    268         } elseif ('trackback' == $comment_type) { 
    269             $notify_message  = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n"; 
    270             /* translators: 1: website name, 2: author IP, 3: author domain */ 
    271             $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 
    272             $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n"; 
    273             $notify_message .= __('Excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n"; 
    274             $notify_message .= __('You can see all trackbacks on this post here: ') . "\r\n"; 
    275             /* translators: 1: blog name, 2: post title */ 
    276             $subject = sprintf( __('[%1$s] Trackback: "%2$s"'), $blogname, $post->post_title ); 
    277         } elseif ('pingback' == $comment_type) { 
    278             $notify_message  = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n"; 
    279             /* translators: 1: comment author, 2: author IP, 3: author domain */ 
    280             $notify_message .= sprintf( __('Website: %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; 
    281             $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n"; 
    282             $notify_message .= __('Excerpt: ') . "\r\n" . sprintf('[...] %s [...]', $comment->comment_content ) . "\r\n\r\n"; 
    283             $notify_message .= __('You can see all pingbacks on this post here: ') . "\r\n"; 
    284             /* translators: 1: blog name, 2: post title */ 
    285             $subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title ); 
    286         } 
    287         $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n"; 
    288         $notify_message .= sprintf( __('Permalink: %s'), get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n"; 
    289         if ( EMPTY_TRASH_DAYS ) 
    290             $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n"; 
    291         else 
    292             $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n"; 
    293         $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n"; 
    294  
    295         $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); 
    296  
    297         if ( '' == $comment->comment_author ) { 
    298             $from = "From: \"$blogname\" <$wp_email>"; 
    299             if ( '' != $comment->comment_author_email ) 
    300                 $reply_to = "Reply-To: $comment->comment_author_email"; 
    301         } else { 
    302             $from = "From: \"$comment->comment_author\" <$wp_email>"; 
    303             if ( '' != $comment->comment_author_email ) 
    304                 $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>"; 
    305         } 
    306  
    307         $message_headers = "$from\n" 
    308             . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    309  
    310         if ( isset($reply_to) ) 
    311             $message_headers .= $reply_to . "\n"; 
    312  
    313         $notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id); 
    314         $subject = apply_filters('comment_notification_subject', $subject, $comment_id); 
    315         $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id); 
    316          
    317         /* 
    318          * Begin changes here 
    319          *  
    320          * Instead of emailing only to the post author, build an array of email addresses, 
    321          * and email each one 
    322          */ 
    323         global $cbnet_macn_options; 
    324          
    325         // Add post author to $email_to array 
    326         $email_to = array( $author->user_email ); 
    327          
    328         // Add Plugin email addresses 
    329         $email_to = array_unique( array_merge( $email_to, cbnet_macn_get_notification_email_addresses() ) ); 
    330          
    331         // Send notification emails. 
    332         // 
    333         // Don't email if user is logged in, and 
    334         // notify_for_registered_users is false 
    335         if ( ! ( is_user_logged_in() && false == $cbnet_macn_options['notify_for_registered_users'] ) ) { 
    336             foreach ( $email_to as $email ) { 
    337                 @wp_mail( $email, $subject, $notify_message, $message_headers ); 
    338             } 
    339         } 
    340  
    341         return true; 
    342     } 
    343 } 
    344 >>>>>>> b0050ec04ed4b3934a36b1d3afdf97f4152d733c 
    345205?> 
  • cbnet-multi-author-comment-notification/trunk/readme.txt

    r664904 r664977  
    55Requires at least: 3.0 
    66Tested up to: 3.5.1 
    7 Stable tag: 2.1.2 
     7Stable tag: 2.2.1 
    88 
    99Send comment notification and comment moderation emails to multiple users. Select users individually or by user role, or send emails to arbitrary email addresses. 
     
    5454== Changelog == 
    5555 
     56= 2.2.1 = 
     57* Bugfix 
     58 * Fixed issue with bad development file merge causing PHP errors 
    5659= 2.2 = 
    5760* Feature Release 
     
    9699== Upgrade Notice == 
    97100 
     101= 2.2.1 = 
     102Bugfix. Fixed issues with bad development file merge. 
    98103= 2.2 = 
    99104Feature release. Option to add comment moderation emails to multiple authors. New filters. 
  • cbnet-multi-author-comment-notification/trunk/settings.php

    r664848 r664977  
    1 <<<<<<< HEAD 
    21<?php 
    32/** 
     
    318317 
    319318} 
    320 ======= 
    321 <?php 
    322 /** 
    323  * Plugin Settings API Implementation 
    324  */ 
    325  
    326 /** 
    327  * Globalize Plugin options 
    328  */ 
    329 global $cbnet_macn_options; 
    330 $cbnet_macn_options = cbnet_macn_get_options(); 
    331  
    332 /** 
    333  * Get Plugin options 
    334  */ 
    335 function cbnet_macn_get_options() { 
    336     return wp_parse_args( get_option( 'plugin_cbnet_macn_options', array() ), cbnet_macn_get_option_defaults() ); 
    337 } 
    338  
    339 /** 
    340  * Get Plugin option defaults 
    341  */ 
    342 function cbnet_macn_get_option_defaults() { 
    343     $defaults = array(   
    344         'all_administrators' => false, 
    345         'all_editors' => false, 
    346         'all_authors' => false, 
    347         'all_contributors' => false, 
    348         'all_subscribers' => false, 
    349         'additional_emails' => false, 
    350         'notify_for_registered_users' => true 
    351     ); 
    352     return apply_filters( 'cbnet_macn_option_defaults', $defaults ); 
    353 } 
    354  
    355 /** 
    356  * Get Plugin option parameters 
    357  */ 
    358 function cbnet_macn_get_option_parameters() { 
    359     $defaults = cbnet_macn_get_option_defaults(); 
    360     $parameters = array( 
    361         'all_administrators' => array( 
    362             'name' => 'all_administrators', 
    363             'title' => __( 'All Administrators', 'cbnet_macn' ), 
    364             'description' => __( 'Send comment notification emails to all Administrators', 'cbnet_macn' ), 
    365             'type' => 'checkbox', 
    366             'default' => $defaults['all_administrators'] 
    367         ), 
    368         'all_editors' => array( 
    369             'name' => 'all_editors', 
    370             'title' => __( 'All Editors', 'cbnet_macn' ), 
    371             'description' => __( 'Send comment notification emails to all Editors', 'cbnet_macn' ), 
    372             'type' => 'checkbox', 
    373             'default' => $defaults['all_editors'] 
    374         ), 
    375         'all_authors' => array( 
    376             'name' => 'all_authors', 
    377             'title' => __( 'All Authors', 'cbnet_macn' ), 
    378             'description' => __( 'Send comment notification emails to all Authors', 'cbnet_macn' ), 
    379             'type' => 'checkbox', 
    380             'default' => $defaults['all_authors'] 
    381         ), 
    382         'all_contributors' => array( 
    383             'name' => 'all_contributors', 
    384             'title' => __( 'All Contributors', 'cbnet_macn' ), 
    385             'description' => __( 'Send comment notification emails to all Contributors', 'cbnet_macn' ), 
    386             'type' => 'checkbox', 
    387             'default' => $defaults['all_contributors'] 
    388         ), 
    389         'all_subscribers' => array( 
    390             'name' => 'all_subscribers', 
    391             'title' => __( 'All Subscribers', 'cbnet_macn' ), 
    392             'description' => __( 'Send comment notification emails to all Subscribers', 'cbnet_macn' ), 
    393             'type' => 'checkbox', 
    394             'default' => $defaults['all_subscribers'] 
    395         ), 
    396         'additional_emails' => array( 
    397             'name' => 'additional_emails', 
    398             'title' => __( 'Additional Email Addresses', 'cbnet_macn' ), 
    399             'description' => __( 'Send comment notification emails to these additional email addresses', 'cbnet_macn' ), 
    400             'type' => 'text', 
    401             'sanitize' => 'emailarray', 
    402             'default' => $defaults['additional_emails'] 
    403         ), 
    404         'notify_for_registered_users' => array( 
    405             'name' => 'notify_for_registered_users', 
    406             'title' => __( 'Registered-User Comments', 'cbnet_macn' ), 
    407             'description' => __( 'Send notification emails for comments from registered users', 'cbnet_macn' ), 
    408             'type' => 'checkbox', 
    409             'default' => $defaults['notify_for_registered_users'] 
    410         ), 
    411     ); 
    412     return apply_filters( 'cbnet_macn_option_parameters', $parameters ); 
    413 } 
    414   
    415 /** 
    416  * Register Plugin Settings 
    417  */ 
    418 function cbnet_macn_register_settings() { 
    419  
    420     /** 
    421     * Register Favicon setting 
    422     *  
    423     * Registers Favicon setting as 
    424     * part of core General settings 
    425     */ 
    426     register_setting( 'discussion', 'plugin_cbnet_macn_options', 'cbnet_macn_validate_settings' ); 
    427  
    428     /** 
    429      * Add settings section to Settings -> Discussion 
    430      */ 
    431     add_settings_section( 'cbnet_macn', __( 'cbnet Multi-Author Comment Notification Settings', 'cbnet_macn' ), 'cbnet_macn_settings_section', 'discussion' );   
    432      
    433     /** 
    434      * Discussion settings section callback 
    435      */ 
    436     function cbnet_macn_settings_section() { 
    437         echo '<p>' . __( 'Configure cbnet Multi-Author Comment Notification settings here.', 'cbnet_macn' ) . '</p>'; 
    438     } 
    439  
    440     /** 
    441     * Add user roles setting field 
    442     *  
    443     * Adds setting fields to  
    444     * Settings -> Discussion 
    445     */ 
    446     add_settings_field( 'cbnet_macn_user_roles', '<label for="cbnet_macn_user_roles">' . __( 'User Roles' , 'cbnet_macn' ) . '</label>', 'cbnet_macn_settings_field_user_roles', 'discussion', 'cbnet_macn' ); 
    447      
    448     /** 
    449      * User roles setting fields callback 
    450      */ 
    451     function cbnet_macn_settings_field_user_roles() { 
    452         global $cbnet_macn_options; 
    453         $option_parameters = cbnet_macn_get_option_parameters(); 
    454         ?> 
    455         <p> 
    456             <input type="checkbox" name="plugin_cbnet_macn_options[all_administrators]" value="true" <?php checked( true == $cbnet_macn_options['all_administrators'] ); ?>> 
    457             <?php echo $option_parameters['all_administrators']['description']; ?> 
    458             <br /> 
    459             <input type="checkbox" name="plugin_cbnet_macn_options[all_editors]" value="true" <?php checked( true == $cbnet_macn_options['all_editors'] ); ?>> 
    460             <?php echo $option_parameters['all_editors']['description']; ?> 
    461             <br /> 
    462             <input type="checkbox" name="plugin_cbnet_macn_options[all_authors]" value="true" <?php checked( true == $cbnet_macn_options['all_authors'] ); ?>> 
    463             <?php echo $option_parameters['all_authors']['description']; ?> 
    464             <br /> 
    465             <input type="checkbox" name="plugin_cbnet_macn_options[all_contributors]" value="true" <?php checked( true == $cbnet_macn_options['all_contributors'] ); ?>> 
    466             <?php echo $option_parameters['all_contributors']['description']; ?> 
    467             <br /> 
    468             <input type="checkbox" name="plugin_cbnet_macn_options[all_subscribers]" value="true" <?php checked( true == $cbnet_macn_options['all_subscribers'] ); ?>> 
    469             <?php echo $option_parameters['all_subscribers']['description']; ?> 
    470             <br /> 
    471         </p> 
    472         <?php 
    473     } 
    474  
    475     /** 
    476     * Add additional emails setting field 
    477     *  
    478     * Adds setting field to  
    479     * Settings -> Discussion 
    480     */ 
    481     add_settings_field( 'cbnet_macn_additional_emails', '<label for="cbnet_macn_additional_emails">' . __( 'Additional Emails' , 'cbnet_macn' ) . '</label>', 'cbnet_macn_settings_field_additional_emails', 'discussion', 'cbnet_macn' ); 
    482      
    483     /** 
    484      * Additional emails setting fields callback 
    485      */ 
    486     function cbnet_macn_settings_field_additional_emails() { 
    487         global $cbnet_macn_options; 
    488         $option_parameters = cbnet_macn_get_option_parameters(); 
    489         $additional_emails = ( is_array( $cbnet_macn_options['additional_emails'] ) ? implode( $cbnet_macn_options['additional_emails'], ',' ) : '' ); 
    490         ?> 
    491         <p> 
    492             <input type="text" size="80" name="plugin_cbnet_macn_options[additional_emails]" value="<?php echo esc_attr( $additional_emails ); ?>" /> 
    493             <br /> 
    494             <?php echo $option_parameters['additional_emails']['description']; ?> 
    495         </p> 
    496         <?php 
    497     } 
    498  
    499     /** 
    500     * Add Miscellaneous setting field 
    501     *  
    502     * Adds setting field to  
    503     * Settings -> Discussion 
    504     */ 
    505     add_settings_field( 'cbnet_macn_misc', '<label for="cbnet_macn_misc">' . __( 'Miscellaneous' , 'cbnet_macn' ) . '</label>', 'cbnet_macn_settings_field_misc', 'discussion', 'cbnet_macn' ); 
    506      
    507     /** 
    508      * CAPTCHA image setting fields callback 
    509      */ 
    510     function cbnet_macn_settings_field_misc() { 
    511         global $cbnet_macn_options; 
    512         $option_parameters = cbnet_macn_get_option_parameters(); 
    513         ?> 
    514         <p> 
    515             <input type="checkbox" name="plugin_cbnet_macn_options[notify_for_registered_users]" value="true" <?php checked( true == $cbnet_macn_options['notify_for_registered_users'] ); ?>> 
    516             <?php echo $option_parameters['notify_for_registered_users']['description']; ?> 
    517         </p> 
    518         <?php 
    519     } 
    520 } 
    521 add_action( 'admin_init', 'cbnet_macn_register_settings' ); 
    522  
    523  
    524  
    525 /** 
    526  * Plugin register_setting() sanitize callback 
    527  *  
    528  * Validate and whitelist user-input data before updating Plugin  
    529  * Options in the database. Only whitelisted options are passed 
    530  * back to the database, and user-input data for all whitelisted 
    531  * options are sanitized. 
    532  *  
    533  * @link    http://codex.wordpress.org/Data_Validation  Codex Reference: Data Validation 
    534  *  
    535  * @param   array   $input  Raw user-input data submitted via the Plugin Settings page 
    536  * @return  array   $input  Sanitized user-input data passed to the database 
    537  */ 
    538 function cbnet_macn_validate_settings( $input ) { 
    539  
    540     // This is the "whitelist": current settings 
    541     global $cbnet_macn_options; 
    542     $valid_input = $cbnet_macn_options; 
    543     // Get the array of option parameters 
    544     $option_parameters = cbnet_macn_get_option_parameters(); 
    545     // Get the array of option defaults 
    546     $option_defaults = cbnet_macn_get_option_defaults(); 
    547      
    548     // Determine what type of submit was input 
    549     $submittype = ( ! empty( $input['reset'] ) ? 'reset' : 'submit' );   
    550      
    551     // Loop through each setting 
    552     foreach ( $option_defaults as $setting => $value ) { 
    553          
    554         // If submit, validate/sanitize $input 
    555         if ( 'submit' == $submittype ) { 
    556          
    557             // Get the setting details from the defaults array 
    558             $optiondetails = $option_parameters[$setting]; 
    559             // Get the array of valid options, if applicable 
    560             $valid_options = ( isset( $optiondetails['valid_options'] ) ? $optiondetails['valid_options'] : false ); 
    561              
    562             // Validate checkbox fields 
    563             if ( 'checkbox' == $optiondetails['type'] ) { 
    564                 // If input value is set and is true, return true; otherwise return false 
    565                 $valid_input[$setting] = ( ( isset( $input[$setting] ) && true == $input[$setting] ) ? true : false ); 
    566             } 
    567             // Validate radio button fields 
    568             else if ( 'radio' == $optiondetails['type'] ) { 
    569                 // Only update setting if input value is in the list of valid options 
    570                 $valid_input[$setting] = ( array_key_exists( $input[$setting], $valid_options ) ? $input[$setting] : $valid_input[$setting] ); 
    571             } 
    572             // Validate select fields 
    573             else if ( 'select' == $optiondetails['type'] ) { 
    574                 // Only update setting if input value is in the list of valid options 
    575                 $valid_input[$setting] = ( in_array( $input[$setting], $valid_options ) ? $input[$setting] : $valid_input[$setting] ); 
    576             } 
    577             // Validate text input and textarea fields 
    578             else if ( ( 'text' == $optiondetails['type'] || 'textarea' == $optiondetails['type'] ) ) { 
    579                 // Validate no-HTML content 
    580                 if ( 'nohtml' == $optiondetails['sanitize'] ) { 
    581                     // Pass input data through the wp_filter_nohtml_kses filter 
    582                     $valid_input[$setting] = wp_filter_nohtml_kses( $input[$setting] ); 
    583                 } 
    584                 // Validate HTML content 
    585                 if ( 'html' == $optiondetails['sanitize'] ) { 
    586                     // Pass input data through the wp_filter_kses filter 
    587                     $valid_input[$setting] = wp_filter_kses( $input[$setting] ); 
    588                 } 
    589                 // Validate integer content 
    590                 if ( 'integer' == $optiondetails['sanitize'] ) {  
    591                     // Verify value is an integer 
    592                     $valid_input[$setting] = ( is_int( (int) $input[$setting] ) ? $input[$setting] : $valid_input[$setting] ); 
    593                 } 
    594                 // Validate RGB content 
    595                 if ( 'rgb' == $optiondetails['sanitize'] ) {  
    596                     // Verify value is an integer 
    597                     $valid_input[$setting] = ( ( is_int( (int) $input[$setting] ) && 0 <= (int) $input[$setting] && 255 >= (int) $input[$setting] ) ? $input[$setting] : $valid_input[$setting] ); 
    598                 } 
    599                 // Validate Email Array content 
    600                 if ( 'emailarray' == $optiondetails['sanitize'] ) { 
    601                     // Create array 
    602                     if ( false == strpos( $input[$setting], ',' ) ) { 
    603                         $input_emails = array( $input[$setting] ); 
    604                     } else { 
    605                         $input_emails = ( '' != $input[$setting] ? explode( ',', $input[$setting] ) : false ); 
    606                     } 
    607                     // Verify values are valid email addresses 
    608                     if ( false != $input_emails ) { 
    609                         foreach ( $input_emails as $email ) { 
    610                             $email = trim( $email ); 
    611                             if ( ! is_email( $email ) ) { unset( $input_emails[$email] ); } 
    612                         } 
    613                     } 
    614                     $valid_input[$setting] = ( ! empty( $input_emails ) ? $input_emails : false ); 
    615                 } 
    616             } 
    617         }  
    618         // If reset, reset defaults 
    619         elseif ( 'reset' == $submittype ) { 
    620             // Set $setting to the default value 
    621             $valid_input[$setting] = $option_defaults[$setting]; 
    622         } 
    623     } 
    624     return $valid_input;         
    625  
    626 } 
    627 >>>>>>> b0050ec04ed4b3934a36b1d3afdf97f4152d733c 
    628319?> 
Note: See TracChangeset for help on using the changeset viewer.