gde_profile_checkbox

The Google Doc Embedder gde profile checkbox function.

Description

gde_profile_checkbox( $option, $field, $label, (string) $wrap = '', (string) $br = '' ); 

Parameters (5)

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

Usage

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

Defined (1)

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

/options.php  
  1. function gde_profile_checkbox( $option, $field, $label, $wrap = '', $br = '' ) { 
  2. if ( ! empty( $wrap ) ) { 
  3. echo '<span id="'.esc_attr($wrap).'">'; 
  4. echo '<input type="checkbox" id="'.esc_attr($field).'" name="'.esc_attr($field).'"'; 
  5.  
  6. // toolbar items 
  7. if ( substr( $field, 0, 5 ) == "gdet_" ) { 
  8. if ( $field == "gdet_h" && strstr( $option, str_replace( "gdet_", "", $field ) ) ) { 
  9. echo ' checked="checked"'; 
  10. } elseif ( $field !== "gdet_h" && ! strstr( $option, str_replace( "gdet_", "", $field ) ) ) { 
  11. echo ' checked="checked"'; 
  12. // open in new window 
  13. } elseif ( $field == "fs_win" && $option !== "same" ) { 
  14. echo ' checked="checked"'; 
  15. // logged-in users only 
  16. } elseif ( $field == "fs_user" && $option == "yes" ) { 
  17. echo ' checked="checked"'; 
  18. // allow print 
  19. } elseif ( $field == "fs_print" && $option !== "no" ) { 
  20. echo ' checked="checked"'; 
  21. // content area options 
  22. } elseif ( substr( $field, 0, 5 ) == "gdev_" ) { 
  23. if ( strstr( $option, str_replace( "gdev_", "", $field ) ) ) { 
  24. echo ' checked="checked"'; 
  25. // doc security options 
  26. } elseif ( $field == "force" && $option !== "no" ) { 
  27. echo ' checked="checked"'; 
  28. } elseif ( $field == "mask" && $option !== "no" ) { 
  29. echo ' checked="checked"'; 
  30. } elseif ( $field == "block" && $option !== "no" ) { 
  31. echo ' checked="checked"'; 
  32.  
  33. echo ' value="'.esc_attr($field).'"> <label for="'.esc_attr($field).'">'.htmlentities($label).'</label>'; 
  34. if ( ! empty( $br ) ) { 
  35. echo '<br/>'; 
  36. if ( ! empty( $wrap ) ) { 
  37. echo '</span>';