gl_field_checkbox

General Option field callback.

Description

gl_field_checkbox( $settings_values, $settings_key, $key, (constant) $short_desc = null, (null) $desc = null ); 

Parameters (5)

0. $settings_values
The settings values.
1. $settings_key
The settings key.
2. $key
The key.
3. $short_desc — Optional. (constant) => null
The short desc.
4. $desc — Optional. (null) => null
The desc.

Usage

  1. if ( !function_exists( 'gl_field_checkbox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-locker-for-wordpress/admin/pages.php'; 
  3.  
  4. // The settings values. 
  5. $settings_values = null; 
  6.  
  7. // The settings key. 
  8. $settings_key = null; 
  9.  
  10. // The key. 
  11. $key = null; 
  12.  
  13. // The short desc. 
  14. $short_desc = null; 
  15.  
  16. // The desc. 
  17. $desc = null; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = gl_field_checkbox($settings_values, $settings_key, $key, $short_desc, $desc); 
  21.  

Defined (1)

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

/admin/pages.php  
  1. function gl_field_checkbox( $settings_values, $settings_key, $key, $short_desc = null, $desc = null ) { 
  2. ?> 
  3. <input type="checkbox" name="<?php echo $settings_key; ?>[<?php echo $key; ?>]" value="1" <?php echo esc_attr( $settings_values[$key]? "checked" : "" ); ?>> <?php if ( $short_desc ) echo $short_desc; ?><br><br> 
  4. <span style="color:#999"><em><?php if ( $desc ) echo $desc; ?></em></span> 
  5. <?php