monsterinsights_checkbox_callback

Checkbox Callback.

Description

monsterinsights_checkbox_callback( (array) $args ); 

Renders checkboxes.

Parameters (1)

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

Usage

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

Defined (1)

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

/includes/admin/settings/settings-api.php  
  1. function monsterinsights_checkbox_callback( $args ) { 
  2. $monsterinsights_option = monsterinsights_get_option( $args['id'] ); 
  3.  
  4. if ( isset( $args['faux'] ) && true === $args['faux'] ) { 
  5. $name = ''; 
  6. } else { 
  7. $name = 'name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']"'; 
  8.  
  9. $class = monsterinsights_sanitize_html_class( $args['field_class'] ); 
  10.  
  11. $checked = ! empty( $monsterinsights_option ) ? checked( 1, $monsterinsights_option, false ) : ''; 
  12. $html = '<input type="checkbox" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']"' . $name . ' value="1" ' . $checked . ' class="' . $class . '"/>'; 
  13. $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>'; 
  14.  
  15. return apply_filters( 'monsterinsights_after_setting_output', $html, $args );