monsterinsights_rich_editor_callback

Rich Editor Callback.

Description

monsterinsights_rich_editor_callback( (array) $args ); 

Renders rich editor fields.

Parameters (1)

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

Usage

  1. if ( !function_exists( 'monsterinsights_rich_editor_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_rich_editor_callback($args); 
  9.  

Defined (1)

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

/includes/admin/settings/settings-api.php  
  1. function monsterinsights_rich_editor_callback( $args ) { 
  2. $monsterinsights_option = monsterinsights_get_option( $args['id'] ); 
  3.  
  4. if ( $monsterinsights_option ) { 
  5. $value = $monsterinsights_option; 
  6. } else { 
  7. if( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) { 
  8. $value = ''; 
  9. } else { 
  10. $value = isset( $args['std'] ) ? $args['std'] : ''; 
  11.  
  12. $rows = isset( $args['size'] ) ? $args['size'] : 20; 
  13.  
  14. $class = monsterinsights_sanitize_html_class( $args['field_class'] ); 
  15.  
  16. ob_start(); 
  17. wp_editor( stripslashes( $value ), 'monsterinsights_settings_' . esc_attr( $args['id'] ), array( 'textarea_name' => 'monsterinsights_settings[' . esc_attr( $args['id'] ) . ']', 'textarea_rows' => absint( $rows ), 'editor_class' => $class ) ); 
  18. $html = ob_get_clean(); 
  19.  
  20. $html .= '<br/><p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; 
  21.  
  22. return apply_filters( 'monsterinsights_after_setting_output', $html, $args );