Skip to content

Commit

Permalink
remove gutenberg option, set default body size, set BS4 as default
Browse files Browse the repository at this point in the history
  • Loading branch information
neilgee committed Oct 9, 2019
1 parent 634c430 commit 1dcb76c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 65 deletions.
59 changes: 24 additions & 35 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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' ) ) {
Expand Down Expand Up @@ -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();
Expand All @@ -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
Expand Down
6 changes: 5 additions & 1 deletion includes-child/customizer-filtered.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
30 changes: 1 addition & 29 deletions includes-child/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1dcb76c

Please sign in to comment.