100, 'width' => 100, 'flex-height' => true, 'flex-width' => true));
add_theme_support('custom-header');
add_theme_support('custom-background');
add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script'));
add_editor_style('style.css');
register_nav_menus(array('primary' => esc_html__('Primary Menu', 'binary-log-pro')));
}
add_action('after_setup_theme', 'binary_log_pro_setup');
function binary_log_pro_scripts() {
wp_enqueue_style('binary-style', get_stylesheet_uri(), array(), '1.0.1.2');
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'binary_log_pro_scripts', 999);
function binary_log_pro_body_classes($classes) {
$license = get_theme_mod('binary_license_key', '');
$scheme = get_theme_mod('binary_color_scheme', 'blue');
if (!empty($license) && $scheme !== 'blue') { $classes[] = 'theme-' . $scheme; }
return $classes;
}
add_filter('body_class', 'binary_log_pro_body_classes');
function binary_log_pro_widgets_init() {
register_sidebar(array(
'name' => esc_html__('Sidebar', 'binary-log-pro'),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
));
}
add_action('widgets_init', 'binary_log_pro_widgets_init');
function binary_log_pro_customize_register($wp_customize) {
// LICENSING
$wp_customize->add_section('binary_license', array('title' => 'Licensing', 'priority' => 10));
$wp_customize->add_setting('binary_license_key', array('default' => '', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('binary_license_key', array('label' => 'License Key', 'section' => 'binary_license'));
// DESIGN
$wp_customize->add_section('binary_design', array('title' => 'Design & Home', 'priority' => 20));
$wp_customize->add_setting('binary_home_title', array('default' => 'System Logs', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('binary_home_title', array('label' => 'Homepage Headline', 'section' => 'binary_design'));
$wp_customize->add_setting('binary_custom_copyright', array('default' => 'Dominique Blake-Hofer', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('binary_custom_copyright', array('label' => 'Copyright Name', 'section' => 'binary_design'));
$license_active = !empty(get_theme_mod('binary_license_key'));
if ($license_active) {
$wp_customize->add_setting('binary_color_scheme', array('default' => 'blue', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('binary_color_scheme', array('label' => 'Color Scheme', 'section' => 'binary_design', 'type' => 'select', 'choices' => array('blue' => 'Blue', 'green' => 'Green', 'dark' => 'Dark')));
$wp_customize->add_section('binary_pro', array('title' => 'Binary Pro Features', 'priority' => 30));
$wp_customize->add_setting('binary_shell_text', array('default' => 'ROOT@BLAKE-HOFER:~#', 'sanitize_callback' => 'sanitize_text_field'));
$wp_customize->add_control('binary_shell_text', array('label' => 'Shell Text', 'section' => 'binary_pro'));
$wp_customize->add_setting('binary_disable_sidebar', array('default' => false, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('binary_disable_sidebar', array('label' => 'Disable Sidebar (Full Width)', 'section' => 'binary_pro', 'type' => 'checkbox'));
$wp_customize->add_setting('binary_hide_status', array('default' => false, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('binary_hide_status', array('label' => 'Hide Status Badge', 'section' => 'binary_pro', 'type' => 'checkbox'));
$wp_customize->add_setting('binary_hide_uptime', array('default' => false, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('binary_hide_uptime', array('label' => 'Hide Uptime Info', 'section' => 'binary_pro', 'type' => 'checkbox'));
$wp_customize->add_setting('binary_hide_branding', array('default' => false, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('binary_hide_branding', array('label' => 'Hide Theme Branding', 'section' => 'binary_pro', 'type' => 'checkbox'));
}
}
add_action('customize_register', 'binary_log_pro_customize_register');