monsterinsights_unfiltered_textarea_callback

Unfiltered Textarea Callback.

Description

monsterinsights_unfiltered_textarea_callback( (array) $args ); 

Renders unfiltered textarea fields.

Parameters (1)

0. $args (array)
Arguments passed by the setting

Usage

  1. if ( !function_exists( 'monsterinsights_unfiltered_textarea_callback' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/settings/settings-api.php'; 
  3.  
  4. // Arguments passed by the setting 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_unfiltered_textarea_callback($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/settings/settings-api.php  
  1. function monsterinsights_unfiltered_textarea_callback( $args ) { 
  2.  
  3. if ( current_user_can( 'unfiltered_html' ) || current_user_can( 'monsterinsights_unfiltered_html' ) ) { 
  4. $monsterinsights_option = monsterinsights_get_option( $args['id'] ); 
  5.  
  6. if ( $monsterinsights_option ) { 
  7. $value = $monsterinsights_option; 
  8. } else { 
  9. $value = isset( $args['std'] ) ? $args['std'] : ''; 
  10.  
  11. $class = monsterinsights_sanitize_html_class( $args['field_class'] ); 
  12.  
  13. $html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . stripslashes( $value ) . '</textarea>'; 
  14. $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; 
  15. } else { 
  16. $html .= sprintf( esc_html__( 'You must have the %s capability to view/edit this setting', 'google-analytics-for-wordpress' ), '"unfiltered_html"' ); 
  17.  
  18. return apply_filters( 'monsterinsights_after_setting_output', $html, $args );