100, 'width' => 100, 'flex-height' => true, 'flex-width' => true));
add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'style', 'script'));
// Support for Editor Styles
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');
// 2. SCRIPTS & STYLES
function binary_log_pro_scripts() {
wp_enqueue_style('binary-style', get_stylesheet_uri(), array(), '1.0.1');
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
add_action('wp_enqueue_scripts', 'binary_log_pro_scripts');
// Body Classes for Color Scheme
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');
// 3. SIDEBAR REGISTRATION
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');
// 4. CUSTOMIZER
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'));
$shop_url = esc_url('https://blake-hofer.net/shop/article_detail.php?id=12&lang=en');
$wp_customize->add_control('binary_license_key', array(
'label' => 'License Key',
'section' => 'binary_license',
'description' => sprintf( __('Get your Pro key here: Shop', 'binary-log-pro'), $shop_url ),
));
// Design
$wp_customize->add_section('binary_design', array('title' => 'Design & Footer', 'priority' => 20));
$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' => 'BINARY Blue', 'green' => 'TERMINAL Green', 'dark' => 'MATRIX DarkMode')
));
} else {
$demo_url = esc_url('https://binary.blake-hofer.net');
$wp_customize->add_setting('binary_color_promo', array('sanitize_callback' => 'esc_html'));
$wp_customize->add_control(new WP_Customize_Control($wp_customize, 'binary_color_promo', array(
'label' => 'Color Schemes (Pro)',
'section' => 'binary_design',
'type' => 'hidden',
'description' => sprintf( __('Demo here: View Demo', 'binary-log-pro'), $demo_url ),
)));
}
$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'));
// Pro Features
if ($license_active) {
$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_hide_status', array('default' => false, 'sanitize_callback' => 'absint'));
$wp_customize->add_control('binary_hide_status', array('label' => 'Hide Status', '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 Branding', 'section' => 'binary_pro', 'type' => 'checkbox'));
}
}
add_action('customize_register', 'binary_log_pro_customize_register');