AtD_print_option

A convienence function to display the HTML for an AtD option.

Description

AtD_print_option( (string) $name, $value, $options ); 

Parameters (3)

0. $name (string)
The name.
1. $value
The value.
2. $options
The options.

Usage

  1. if ( !function_exists( 'AtD_print_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/after-the-deadline/config-options.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The value. 
  8. $value = null; 
  9.  
  10. // The options. 
  11. $options = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = AtD_print_option($name, $value, $options); 
  15.  

Defined (1)

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

/modules/after-the-deadline/config-options.php  
  1. function AtD_print_option( $name, $value, $options ) { 
  2. // Attribute-safe version of $name 
  3. $attr_name = sanitize_title($name); // Using sanitize_title since there's no comparable function for attributes 
  4. ?> 
  5. <input type="checkbox" id="atd_<?php echo esc_attr( $attr_name ) ?>" name="<?php echo esc_attr( $options['name'] ); ?>[<?php echo esc_attr( $name ); ?>]" value="1" <?php checked( '1', isset( $options[$name] ) ? $options[$name] : false ); ?>> <label for="atd_<?php echo esc_attr( $attr_name ); ?>"><?php echo esc_html( $value ); ?></label> 
  6. <?php