gde_profile_checkbox
The Google Doc Embedder gde profile checkbox function.
Description
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
if ( !function_exists( 'gde_profile_checkbox' ) ) { require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/options.php'; } // The option. $option = null; // The field. $field = null; // The label. $label = null; // The wrap. $wrap = ''; // The br. $br = ''; // NOTICE! Understand what this does before running. $result = gde_profile_checkbox($option, $field, $label, $wrap, $br);
Defined (1)
The function is defined in the following location(s).
- /options.php
- function gde_profile_checkbox( $option, $field, $label, $wrap = '', $br = '' ) {
- if ( ! empty( $wrap ) ) {
- echo '<span id="'.esc_attr($wrap).'">';
- }
- echo '<input type="checkbox" id="'.esc_attr($field).'" name="'.esc_attr($field).'"';
- // toolbar items
- if ( substr( $field, 0, 5 ) == "gdet_" ) {
- if ( $field == "gdet_h" && strstr( $option, str_replace( "gdet_", "", $field ) ) ) {
- echo ' checked="checked"';
- } elseif ( $field !== "gdet_h" && ! strstr( $option, str_replace( "gdet_", "", $field ) ) ) {
- echo ' checked="checked"';
- }
- // open in new window
- } elseif ( $field == "fs_win" && $option !== "same" ) {
- echo ' checked="checked"';
- // logged-in users only
- } elseif ( $field == "fs_user" && $option == "yes" ) {
- echo ' checked="checked"';
- // allow print
- } elseif ( $field == "fs_print" && $option !== "no" ) {
- echo ' checked="checked"';
- // content area options
- } elseif ( substr( $field, 0, 5 ) == "gdev_" ) {
- if ( strstr( $option, str_replace( "gdev_", "", $field ) ) ) {
- echo ' checked="checked"';
- }
- // doc security options
- } elseif ( $field == "force" && $option !== "no" ) {
- echo ' checked="checked"';
- } elseif ( $field == "mask" && $option !== "no" ) {
- echo ' checked="checked"';
- } elseif ( $field == "block" && $option !== "no" ) {
- echo ' checked="checked"';
- }
- echo ' value="'.esc_attr($field).'"> <label for="'.esc_attr($field).'">'.htmlentities($label).'</label>';
- if ( ! empty( $br ) ) {
- echo '<br/>';
- }
- if ( ! empty( $wrap ) ) {
- echo '</span>';
- }
- }