gde_opts_checkbox

The Google Doc Embedder gde opts checkbox function.

Description

gde_opts_checkbox( $field, $label, (string) $wrap = '', (string) $br = '', (bool) $disabled = false ); 

Parameters (5)

0. $field
The field.
1. $label
The label.
2. $wrap — Optional. (string) => ''
The wrap.
3. $br — Optional. (string) => ''
The br.
4. $disabled — Optional. (bool) => false
The disabled.

Usage

  1. if ( !function_exists( 'gde_opts_checkbox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/options.php'; 
  3.  
  4. // The field. 
  5. $field = null; 
  6.  
  7. // The label. 
  8. $label = null; 
  9.  
  10. // The wrap. 
  11. $wrap = ''; 
  12.  
  13. // The br. 
  14. $br = ''; 
  15.  
  16. // The disabled. 
  17. $disabled = false; 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = gde_opts_checkbox($field, $label, $wrap, $br, $disabled); 
  21.  

Defined (1)

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

/options.php  
  1. function gde_opts_checkbox( $field, $label, $wrap = '', $br = '', $disabled = false ) { 
  2. global $gdeoptions; 
  3.  
  4. if ( ! empty( $wrap ) ) { 
  5. echo '<span id="'.esc_attr($wrap).'">'; 
  6. echo '<input type="checkbox" id="'.esc_attr($field).'" name="'.esc_attr($field).'"'; 
  7. if ( ( isset( $gdeoptions[$field] ) && $gdeoptions[$field] == "yes" ) || ( $disabled ) ) { 
  8. echo ' checked="checked"'; 
  9. if ( $disabled ) { 
  10. // used only for dx logging option due to global override in functions.php 
  11. echo ' disabled="disabled"'; 
  12.  
  13. echo ' value="'.esc_attr($field).'"> <label for="'.esc_attr($field).'">'.htmlentities($label).'</label>'; 
  14. if ( ! empty( $br ) ) { 
  15. echo '<br/>'; 
  16. if ( ! empty( $wrap ) ) { 
  17. echo '</span>';