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
if ( !function_exists( 'gde_opts_checkbox' ) ) { require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/options.php'; } // The field. $field = null; // The label. $label = null; // The wrap. $wrap = ''; // The br. $br = ''; // The disabled. $disabled = false; // NOTICE! Understand what this does before running. $result = gde_opts_checkbox($field, $label, $wrap, $br, $disabled);
Defined (1)
The function is defined in the following location(s).
- /options.php
- function gde_opts_checkbox( $field, $label, $wrap = '', $br = '', $disabled = false ) {
- global $gdeoptions;
- if ( ! empty( $wrap ) ) {
- echo '<span id="'.$wrap.'">';
- }
- echo '<input type="checkbox" id="'.$field.'" name="'.$field.'"';
- if ( ( isset( $gdeoptions[$field] ) && $gdeoptions[$field] == "yes" ) || ( $disabled ) ) {
- echo ' checked="checked"';
- }
- if ( $disabled ) {
- // used only for dx logging option due to global override in functions.php
- echo ' disabled="disabled"';
- }
- echo ' value="'.$field.'"> <label for="'.$field.'">'.$label.'</label>';
- if ( ! empty( $br ) ) {
- echo '<br/>';
- }
- if ( ! empty( $wrap ) ) {
- echo '</span>';
- }
- }