From 1dcb76c20ed36f7005d0599226c18eea0bc5f775 Mon Sep 17 00:00:00 2001 From: Neil Gee Date: Wed, 9 Oct 2019 19:29:47 +1100 Subject: [PATCH] remove gutenberg option, set default body size, set BS4 as default --- functions.php | 59 +++++++++++--------------- includes-child/customizer-filtered.php | 6 ++- includes-child/customizer.php | 30 +------------ 3 files changed, 30 insertions(+), 65 deletions(-) diff --git a/functions.php b/functions.php index a71d006..41cfad4 100644 --- a/functions.php +++ b/functions.php @@ -120,23 +120,23 @@ function bt_theme_setup() { } /** - * Get the plugins ffrom TGM Plugin Activation - * @since 1.0.0 - */ + * Get the plugins ffrom TGM Plugin Activation + * @since 1.0.0 + */ //require_once get_stylesheet_directory() . '/plugins.php'; /** - * Allow the theme to be translated. - * @since 1.0.0 - */ + * Allow the theme to be translated. + * @since 1.0.0 + */ load_theme_textdomain( 'beavertron', get_stylesheet_directory_uri() . '/languages' ); add_filter( 'intermediate_image_sizes_advanced', 'bt_remove_default_images' ); /** - * Remove default image sizes - * @since 1.0.0 - */ + * Remove default image sizes + * @since 1.0.0 + */ function bt_remove_default_images( $sizes ) { // unset( $sizes['small']); // 150px // unset( $sizes['medium']); // 300px @@ -147,18 +147,18 @@ function bt_remove_default_images( $sizes ) { add_filter( 'upload_mimes', 'bt_add_svg_images' ); /** - * Allow SVG Images Via Media Uploader. - * @since 1.0.0 - */ + * Allow SVG Images Via Media Uploader. + * @since 1.0.0 + */ function bt_add_svg_images( $mimetypes ) { $mimetypes['svg'] = 'image/svg+xml'; return $mimetypes; } /** - * Add support for custom logo change the dimensions to suit. Need WordPress 4.5 for this. - * @since 1.0.0 - */ + * Add support for custom logo change the dimensions to suit. Need WordPress 4.5 for this. + * @since 1.0.0 + */ add_theme_support( 'custom-logo', array( 'height' => 100, // set to your dimensions 'width' => 300,// set to your dimensions @@ -168,9 +168,9 @@ function bt_add_svg_images( $mimetypes ) { add_shortcode( 'client_logo', 'bt_client_logo' ); /** - * Position the content with a shortcode [client_logo] - * @since 1.0.0 - */ + * Position the content with a shortcode [client_logo] + * @since 1.0.0 + */ function bt_client_logo() { ob_start(); if ( function_exists( 'the_custom_logo' ) ) { @@ -215,16 +215,16 @@ function bt_image_meta_upon_image_upload( $post_ID ) { } /** - * Allow shortcode to run in widgets. - * @since 1.0.0 - */ + * Allow shortcode to run in widgets. + * @since 1.0.0 + */ add_filter( 'widget_text', 'do_shortcode' ); //add_filter( 'widget_text','bt_execute_php_widgets' ); /** - * Allow PHP code to run in Widgets. - * @since 1.0.0 - */ + * Allow PHP code to run in Widgets. + * @since 1.0.0 + */ function bt_execute_php_widgets( $html ) { if ( strpos( $html, '<' . '?php' ) !== false ) { ob_start(); @@ -235,17 +235,6 @@ function bt_execute_php_widgets( $html ) { return $html; } - /** - * Toggle Gutenberg Block Editor - * @since 1.7.0 - */ - $bt_gutenberg_toggle = get_theme_mod( 'bt_gutenberg_toggle' ); - - if( $bt_gutenberg_toggle === 'disabled' ) { - add_filter( 'use_block_editor_for_post', '__return_false' ); - - - } add_filter( 'fl_ace_editor_settings', 'custom_ace_editor' ); /** * Show line numbers and wrap text in Ace editor diff --git a/includes-child/customizer-filtered.php b/includes-child/customizer-filtered.php index c966bf5..1d61d4f 100644 --- a/includes-child/customizer-filtered.php +++ b/includes-child/customizer-filtered.php @@ -14,7 +14,10 @@ function bt_customizer_options_filtered( $data, $key ) { // Layout $data['sections']['fl-layout']['options']['fl-content-width']['setting']['default']='1200'; $data['sections']['fl-layout']['options']['fl-medium-breakpoint']['setting']['default']='1024'; - $data['sections']['fl-layout']['options']['fl-mobile-breakpoint']['setting']['default']='767'; + $data['sections']['fl-layout']['options']['fl-mobile-breakpoint']['setting']['default']='768'; + + $data['sections']['fl-layout']['options']['fl-framework']['setting']['default']='bootstrap-4'; + $data['sections']['fl-layout']['options']['fl-scroll-to-top']['setting']['default']='enable'; $data['sections']['fl-layout']['options']['fl-awesome']['setting']['default']='fa5'; @@ -28,6 +31,7 @@ function bt_customizer_options_filtered( $data, $key ) { $data['sections']['fl-heading-font']['options']['fl-heading-font-family']['setting']['default']='system-ui'; $data['sections']['fl-body-font']['options']['fl-body-text-color']['setting']['default']='#333333'; $data['sections']['fl-body-font']['options']['fl-body-font-family']['setting']['default']='system-ui'; + $data['sections']['fl-body-font']['options']['fl-body-font-size']['setting']['default']='18'; // Buttons $data['sections']['fl-buttons']['options']['fl-button-style']['setting']['default']='custom'; diff --git a/includes-child/customizer.php b/includes-child/customizer.php index 1ea50cb..360ad75 100644 --- a/includes-child/customizer.php +++ b/includes-child/customizer.php @@ -14,35 +14,7 @@ function bt_register_theme_customizer( $wp_customize ) { global $wp_customize; - - /** - * Add Enable/Disable Gutenberg - * @since 1.7.0 - */ - $wp_customize->add_setting( - 'bt_gutenberg_toggle', //give it an ID - array( - 'default' => 'disabled', - ) - ); - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'bt_gutenberg_toggle_switch', //give it an ID - array ( - 'label' => __( 'Gutenberg', 'beavertron' ), - 'section' => 'fl-layout', - 'settings' => 'bt_gutenberg_toggle', //pick the setting it applies to - 'description' => __( 'Enable or disable Gutenberg Block Editor', 'fl-automator' ), - 'type' => 'select', - 'choices' => array( - 'enabled' => __( 'Enabled', 'beavertron' ), - 'disabled' => __( 'Disabled', 'beavertron' ), - ), - ) - ) - ); - + /* * * Adding in a Hover Control for Buttons to the 'fl-buttons' panel * Also can be done with fl_theme_add_panel_data filter - see 2 examples in customizer-filtered.php