<?php
/**
 * Initialize the custom theme options.
 */
add_action( 'admin_init', 'custom_theme_options' );

/**
 * Build the custom settings & update OptionTree.
 */
function custom_theme_options() {
  
  /* OptionTree is not loaded yet */
  if ( ! function_exists( 'ot_settings_id' ) )
    return false;
    
  /**
   * Get a copy of the saved settings array. 
   */
  $saved_settings = get_option( ot_settings_id(), array() );
  
  /**
   * Custom settings array that will eventually be 
   * passes to the OptionTree Settings API Class.
   */
  $custom_settings = array( 
    'contextual_help' => array( 
      'sidebar'       => ''
    ),
    'sections'        => array( 
      array(
        'id'          => 'general',
        'title'       => __( 'General', 'theme-options' )
      ),
      array(
        'id'          => 'top_bar_display',
        'title'       => __( 'Top Bar Display', 'theme-options' )
      ),
      array(
        'id'          => 'top_bar_options',
        'title'       => __( 'Top Bar Options', 'theme-options' )
      ),
      array(
        'id'          => 'social_accounts',
        'title'       => __( 'Social Accounts', 'theme-options' )
      ),
      array(
        'id'          => 'css',
        'title'       => __( 'CSS', 'theme-options' )
      ),
      array(
        'id'          => 'footer',
        'title'       => __( 'Footer', 'theme-options' )
      ),
      array(
        'id'          => 'domain_lookup_small_widget',
        'title'       => __( 'Domain Lookup Small Widget', 'theme-options' )
      ),
      array(
        'id'          => 'posts',
        'title'       => __( 'Posts', 'theme-options' )
      )
    ),
    'settings'        => array( 
      array(
        'id'          => 'logo_image',
        'label'       => __( 'Logo Image - All4Share.net', 'theme-options' ),
        'desc'        => __( 'Image to be used for logo.', 'theme-options' ),
        'std'         => '',
        'type'        => 'upload',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'logo_width',
        'label'       => __( 'Logo Width', 'theme-options' ),
        'desc'        => __( 'Include the px', 'theme-options' ),
        'std'         => '300px',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
	 array(
        'id'          => 'logo_height',
        'label'       => __( 'Logo Height', 'theme-options' ),
        'desc'        => __( 'Include the px', 'theme-options' ),
        'std'         => '100px',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'show_sticky_menu',
        'label'       => __( 'Show Sticky Menu', 'theme-options' ),
        'desc'        => '',
        'std'         => 'off',
        'type'        => 'on-off',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'order_link_text',
        'label'       => __( 'Order Link Text (featured plans)', 'theme-options' ),
        'desc'        => __( 'Text to be used on order links for hosting plans in featured view.', 'theme-options' ),
        'std'         => 'Sign Up Now!',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'bottom_bar_text',
        'label'       => __( 'Bottom Bar Text', 'theme-options' ),
        'desc'        => '',
        'std'         => '© WebsiteName - Website designed by <a href="http://themeforest.net/user/RoyalTemplates/portfolio">Royal Templates</a>',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'whmcs_url',
        'label'       => __( 'WHMCS URL (no trailing slash)', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'whmcs_dbconnect_path',
        'label'       => __( 'WHMCS init/dbconnect path (init for WHMCS 6)', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'general',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'homepage_page_type',
        'label'       => __( 'Homepage Page Type', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_display',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'page',
        'label'       => __( 'Page', 'theme-options' ),
        'desc'        => '',
        'std'         => 'off',
        'type'        => 'on-off',
        'section'     => 'top_bar_display',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'post',
        'label'       => __( 'Post', 'theme-options' ),
        'desc'        => '',
        'std'         => 'off',
        'type'        => 'on-off',
        'section'     => 'top_bar_display',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'archive',
        'label'       => __( 'Archive', 'theme-options' ),
        'desc'        => '',
        'std'         => 'off',
        'type'        => 'on-off',
        'section'     => 'top_bar_display',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'whmcs',
        'label'       => __( 'WHMCS', 'theme-options' ),
        'desc'        => '',
        'std'         => 'off',
        'type'        => 'on-off',
        'section'     => 'top_bar_display',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_log_in',
        'label'       => __( 'Show Log In', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'log_in_text',
        'label'       => __( 'Log In Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'Log in',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_log_in:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'log_in_html',
        'label'       => __( 'Log In HTML', 'theme-options' ),
        'desc'        => __( 'This can be copied from the integration code section of WHMCS.', 'theme-options' ),
        'std'         => '',
        'type'        => 'textarea-simple',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_log_in:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'client_area_link',
        'label'       => __( 'Show Client Area Link', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'client_area_text',
        'label'       => __( 'Client Area Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'Client Area',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'client_area_link:not(off)',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'client_area_url',
        'label'       => __( 'Client Area URL', 'theme-options' ),
        'desc'        => '',
        'std'         => 'yourwebsite.com/whmcs/clientarea.php',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'client_area_link:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_register_link',
        'label'       => __( 'Show Register Link', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'register_text',
        'label'       => __( 'Register Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'Register',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_register_link:not(off)',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'register_url',
        'label'       => __( 'Register URL', 'theme-options' ),
        'desc'        => '',
        'std'         => 'yourwebsite.com/whmcs/register.php',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_register_link:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_log_out',
        'label'       => __( 'Show Log Out', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'log_out_text',
        'label'       => __( 'Log Out Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'Sign Out',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_log_out:not(off)',
        'operator'    => 'and'
      ),
	  	  array(
        'id'          => 'log_out_url',
        'label'       => __( 'Log Out URL', 'theme-options' ),
        'desc'        => '',
        'std'         => 'yourwebsite.com/whmcs/logout.php',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_log_out:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_cart_link',
        'label'       => __( 'Show Cart Link', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_log_out:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'cart_text',
        'label'       => __( 'Cart Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'View Cart',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_cart_link:not(off)',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'cart_text_url',
        'label'       => __( 'Cart URL', 'theme-options' ),
        'desc'        => '',
        'std'         => 'yourwebsite.com/whmcs/cart.php',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_cart_link:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_language_select',
        'label'       => __( 'Show Language Select', 'theme-options' ),
        'desc'        => 'Only shows up on WHMCS pages.',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_support_dropdown',
        'label'       => __( 'Show Support Dropdown', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_live_support_link',
        'label'       => __( 'Show Live Support Link', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_support_dropdown:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'live_support_link',
        'label'       => __( 'Live Support Link Text', 'theme-options' ),
        'desc'        => '',
        'std'         => 'Live Support',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_support_dropdown:not(off),show_show_live_support_link:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'live_support_link_url',
        'label'       => __( 'Live Support Link URL', 'theme-options' ),
        'desc'        => '',
        'std'         => '#',
        'type'        => 'text',
        'section'     => 'top_bar_options',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => 'show_support_dropdown:not(off),show_show_live_support_link:not(off)',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'facebook',
        'label'       => __( 'Facebook', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'social_accounts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'twitter',
        'label'       => __( 'Twitter', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'social_accounts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'google',
        'label'       => __( 'Google+', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'social_accounts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'pinterest',
        'label'       => __( 'Pinterest', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'social_accounts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'linkedin',
        'label'       => __( 'LinkedIn', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'social_accounts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
	  array(
        'id'          => 'google_api',
        'label'       => __( 'Google Api', 'theme-options' ),
        'desc'        => 'This Google API is used to retrieve the available google fonts.  Api can be found https://console.developers.google.com/.',
        'std'         => '',
        'type'        => 'text',
        'section'     => 'css',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'main_font',
        'label'       => __( 'Main Font', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'typography',
        'section'     => 'css',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'css',
        'label'       => __( 'CSS', 'theme-options' ),
        'desc'        => __( 'To change to new font as selected, copy the following.  Remove all elements you dont want to change:

h2, h1, h3, h4,.btn-lg, .form-submit .submit,#signinbox label,#signinbox input[type="submit"],#supportbox .livesupport,.header &gt; ul &gt; li,.slide-title,.slide-title small,.plan h3,.plan small,.plan ul li,.plan ul li:last-child a,.popover-title,.topfeatures h4,.searchbar input[type="text"],.searchbar select,.domainsearch input[type="submit"],.domain-offers .offer span, #domainprices .container &gt; ul &gt; li:first-child, #domainbulk input[type="submit"], #domainbulk p,#domainbulk .btn-primary, .content-heading h2, .mainfeatures h3, .maintestimonials h3, .viewmore a, .footer-section h4, .newsletter input[type="text"], .newsletter input[type="submit"], .footerheading, .post-image span, .featuredposts h2, .nonfeaturedposts h3, .morelinks, #single-post h2, #single-post h3, #single-post h4, #single-post h5, .optionbar ul li a, .compare-heading li:not(:first-child) , .compare-heading span,.compare-separator, .search-wiki input[type="text"], .search-wiki input[type="submit"]
{{{main_font}}}', 'theme-options' ),
        'std'         => 'h2, h1, h3, h4,.btn-lg, .form-submit .submit,#signinbox label,#signinbox input[type="submit"],#supportbox .livesupport,.header > ul > li,.slide-title,.slide-title small,.plan h3,.plan small,.plan ul li,.plan ul li:last-child a,.popover-title,.topfeatures h4,.searchbar input[type="text"],.searchbar select,.domainsearch input[type="submit"],.domain-offers .offer span, #domainprices .container > ul > li:first-child, #domainbulk input[type="submit"], #domainbulk p,#domainbulk .btn-primary, .content-heading h2, .mainfeatures h3, .maintestimonials h3, .viewmore a, .footer-section h4, .newsletter input[type="text"], .newsletter input[type="submit"], .footerheading, .post-image span, .featuredposts h2, .nonfeaturedposts h3, .morelinks, #single-post h2, #single-post h3, #single-post h4, #single-post h5, .optionbar ul li a, .compare-heading li:not(:first-child) , .compare-heading span,.compare-separator, .search-wiki input[type="text"], .search-wiki input[type="submit"]
{{{main_font}}}',
        'type'        => 'css',
        'section'     => 'css',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'default',
        'label'       => __( 'Default Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'homepage_footer',
        'label'       => __( 'Homepage (page template) Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'page_footer_',
        'label'       => __( 'Page Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'post_footer',
        'label'       => __( 'Post Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'archive_footer',
        'label'       => __( 'Archive Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'whmcs_footer',
        'label'       => __( 'WHMCS Footer', 'theme-options' ),
        'desc'        => '',
        'std'         => '',
        'type'        => 'custom-post-type-select',
        'section'     => 'footer',
        'rows'        => '',
        'post_type'   => 'footer',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'domain_lookup_code',
        'label'       => __( 'Domain Lookup Code', 'theme-options' ),
        'desc'        => __( 'Replace the parts in capitals.  Copy relevant part from integration code on WHMCS.', 'theme-options' ),
        'std'         => '<div class="domainsearch">
<form action="COPY FORM ACTION HERE" method="post"><div class="searchbar">
<input type="hidden" name="direct" value="true" />
<input type="text" name="domain" placeholder="Enter Domain Here"/>
COPY SELECT AND OPTIONS HERE
</div>
<input type="submit" value="Search"/>
</form>
</div>',
        'type'        => 'textarea-simple',
        'section'     => 'domain_lookup_small_widget',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'related_posts_on_single',
        'label'       => __( 'Related Posts on Single', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'posts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_share_links',
        'label'       => __( 'Show Share Links', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'posts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      ),
      array(
        'id'          => 'show_admin_profile',
        'label'       => __( 'Show Admin Profile', 'theme-options' ),
        'desc'        => '',
        'std'         => 'on',
        'type'        => 'on-off',
        'section'     => 'posts',
        'rows'        => '',
        'post_type'   => '',
        'taxonomy'    => '',
        'min_max_step'=> '',
        'class'       => '',
        'condition'   => '',
        'operator'    => 'and'
      )
    )
  );
  
  /* allow settings to be filtered before saving */
  $custom_settings = apply_filters( ot_settings_id() . '_args', $custom_settings );
  
  /* settings are not the same update the DB */
  if ( $saved_settings !== $custom_settings ) {
    update_option( ot_settings_id(), $custom_settings ); 
  }
  
  /* Lets OptionTree know the UI Builder is being overridden */
  global $ot_has_custom_theme_options;
  $ot_has_custom_theme_options = true;
  
}