Plugin Directory

Changeset 2441357


Ignore:
Timestamp:
12/17/2020 10:06:50 AM (5 years ago)
Author:
modernplugins
Message:

Removed support for image editing, custom line-height and custom units

Location:
safe-block-editor
Files:
9 added
2 edited

Legend:

Unmodified
Added
Removed
  • safe-block-editor/trunk/readme.txt

    r2318912 r2441357  
    44Tags: editor, blocks, block editor
    55Requires at least: 5.0
    6 Tested up to: 5.4.1
    7 Stable tag: 1.0
     6Tested up to: 5.5.3
     7Stable tag: 1.1
    88Requires PHP: 5.6
    99License: GPL v3 or later
     
    1919
    2020* Font size picker and custom font size
     21* Custom padding and units
    2122* Color palette, and color picker
    2223* Gradients
    2324* Wide and full alignments
     25* Block patterns
    2426
    2527Blocs removed :
     
    4951
    5052* Anchor
     53* DropCap
     54* Image editing in image block
    5155* HTML view
    5256* Reusable block
     
    63671. Activate the plugin through the 'Plugins' screen in WordPress
    6468
    65 == Frequently Asked Questions ==
    66 
    67 = What about Drop Cap setting ? =
    68 
    69 At the moment there is no easy, clean or future-proof way of removing the drop cap setting. We'll leave it for now.
    70 
    7169== Screenshots ==
    7270
     
    7573== Changelog ==
    7674
     75= 1.1 =
     76* Remove custom units, custom paddings, dropcap image editing, and block patterns
     77
    7778= 1.0 =
    7879* Initial release
     
    8081== Upgrade Notice ==
    8182
     83= 1.1 =
     84* Remove custom units, custom paddings, dropcap image editing, and block patterns
     85
    8286= 1.0 =
    8387Initial release
  • safe-block-editor/trunk/safe-block-editor.php

    r2317115 r2441357  
    33 * Plugin Name:        Safe Block Editor by WPMarmite
    44 * Description:        Simplifies your authoring experience by removing distracting options in the WordPress editor.
    5  * Version:            1.0
     5 * Version:            1.1
    66 * Author:             Modern Plugins
    77 * Author URI:         https://modernplugins.com/
     
    1212 * Domain Path:        languages/
    1313 * Requires at least:  5.0
    14  * Tested up to:       5.4.1
     14 * Tested up to:       5.5.3
    1515 */
    1616
     
    7272    add_theme_support( '__experimental-disable-custom-gradients' );
    7373   
    74     // Disable support for wide and full alignment
     74    // Disable unneeded functionnality
    7575    if( get_theme_support( 'align-wide' ) ){
    7676        remove_theme_support( 'align-wide' );
    7777    }
     78    if( get_theme_support( 'custom-line-height' ) ){
     79        remove_theme_support( 'custom-line-height' );
     80    }
     81    if( get_theme_support( 'custom-units' ) ){
     82        add_theme_support( 'custom-units', array() );
     83    }
     84    if( get_theme_support( 'custom-spacing' ) ){
     85        remove_theme_support('custom-spacing');
     86    }
     87    if( get_theme_support( 'core-block-patterns' ) ){
     88        remove_theme_support( 'core-block-patterns' );
     89    }
     90}
     91
     92
     93add_filter( 'block_editor_settings', 'safe_block_editor_editor_settings', 10, 2 );
     94/**
     95 * Disables image editing
     96 *
     97 * @param   array    $settings  Settings of the editor.
     98 * @param   WP_Post  $post      Current post
     99 * @return  array    $settings
     100 */
     101function safe_block_editor_editor_settings( $settings, $post ){
     102    $settings['imageEditing'] = false;
     103    return $settings;
    78104}
    79105
     
    158184        'anchor'          => false,
    159185        // 'customClassName' => false,
     186        // 'lightBlockWrapper' => true,
    160187        'html'            => false,
    161188        'reusable'        => false,
     189        '__experimentalLineheight' => false,
     190        '__experimentalEnableRichImageEditing' => false,
     191        '__experimentalFeatures' => array(
     192            'typography' => array(
     193                'dropCap' => false
     194            ),
     195        ),
    162196    );
    163197    return apply_filters( 'safe_block_editor_supports', $supports );
     
    170204 */
    171205function safe_block_editor_block_editor_scripts() {
    172     $version = get_plugin_data( __FILE__, false,false )['Version'];
     206    $version = get_plugin_data( __FILE__, false, false )['Version'];
    173207    wp_enqueue_script( 'safe-block-editor-js', SAFE_BLOCK_EDITOR_URL . 'js/block-editor.js', array( 'wp-blocks', 'wp-hooks', 'wp-dom-ready', 'wp-edit-post' ), $version, true );
    174208    wp_enqueue_style( 'safe-block-editor', SAFE_BLOCK_EDITOR_URL . 'css/block-editor.css', array(), $version );
Note: See TracChangeset for help on using the changeset viewer.