Plugin Directory

Changeset 2116856


Ignore:
Timestamp:
07/03/2019 11:47:45 AM (6 years ago)
Author:
webmasterrv
Message:

Custom option to enable/disable Guternberg

Location:
restore-classic-editor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • restore-classic-editor/trunk/readme.txt

    r2091367 r2116856  
    11=== Remove Gutenberg ===
    22Contributors: webmasterrv
    3 Tags: editor, classic editor, block editor, remove gutenberg, gutenberg, disable, blocks, posts, post types
     3Tags: editor, disable guternberg, guternberg manager, remove guternberg, classic editor, block editor, remove gutenberg, gutenberg, disable, blocks, posts, post types
    44Requires PHP: 4.9
    55Requires at least: 4.9
    66Tested up to: 5.2
    7 Stable tag: 1.2
     7Stable tag: 2.0
    88License: GPLv2 or later
    9 Donate link: https://www.jaybhagwandesigns.com
     9Donate link: http://vinairsolutions.in
    1010
    1111Remove Gutenberg Editor and get back to old version of editor. This provides Original Classic Editor and more.
     
    1313== Description ==
    1414
    15 Have you upgraded WordPress and stucked with the new editor? Don't worry, Just install the Remove Guternberg plugin and enjoy the Classic editor.
     15Have you upgraded WordPress and stucked with the new editor? Don't worry, Just install the Remove Guternberg plugin and enjoy the Classic editor. Additionally, There is an option in Reading settings from you can enable/disable the feature.
     16
     17Powered by Group of VinAir Team(http://vinairsolutions.in)
    1618
    1719== Installation ==
     
    2224
    2325== Changelog ==
     26
     27= 2.0 =
     28*Release Date - 03th July, 2019*
     29
     30* You don't need to delete this plugin if you want to disable/re-enable guternberg temporary. There is an option in Reading settings from you can enable/disable the feature.
     31
     32= 1.2 =
     33*Release Date - 20th May, 2019*
     34
     35* Tested upto WordPress 5.2 version.
    2436
    2537= 1.1 =
  • restore-classic-editor/trunk/rm-gutenberg.php

    r2091381 r2116856  
    44    Plugin Name: Remove Gutenberg
    55    Description: Remove Gutenberg Editor and get back to old version of editor. This provides Original Classic Editor and more.
    6     Tags: editor, classic editor, block editor, remove gutenberg, gutenberg, disable, blocks, posts, post types
     6    Tags: editor, disable guternberg, guternberg manager, remove guternberg, classic editor, block editor, remove gutenberg, gutenberg, disable, blocks, posts, post types
    77    Author: Ravi Vadhel
    8     Author URI: https://www.jaybhagwandesigns.com
     8    Author URI: http://vinairsolutions.in
    99    Donate link: Paypal @[email protected]
    1010    Contributors: Ravi A. Vadhel
    1111    Requires at least: 4.9
    1212    Tested up to: 5.0.3
    13     Stable tag: 1.2
    14     Version: 1.2
     13    Stable tag: 2.0
     14    Version: 2.0
    1515    Requires PHP: 5.2.4
    1616    Text Domain: remove-gutenberg
     
    1818    License: GPL v2 or later
    1919*/
    20 
    2120if (!class_exists('removeGutenberg')) {
    2221   
    2322    class removeGutenberg {
    2423        function __construct() {
    25             // disable for posts
    26             add_filter('use_block_editor_for_post', '__return_false', 10);
     24            if(empty(get_option( 'reenable-guternberg' ))){
     25                // disable for posts
     26                add_filter('use_block_editor_for_post', '__return_false', 10);
    2727
    28             // disable for post types
    29             add_filter('use_block_editor_for_post_type', '__return_false', 10);
     28                // disable for post types
     29                add_filter('use_block_editor_for_post_type', '__return_false', 10);
     30            }
    3031        }
    3132    }
     33
     34    /* Admin init */
     35    add_action( 'admin_init', 'my_settings_init' );
     36    function my_settings_init(){
     37        register_setting('reading', 'reenable-guternberg', 'my_settings_sanitize');
     38        add_settings_section('gutenberg_section', 'Gutenberg Settings', 'gutenberg_settings', 'reading');
     39        add_settings_field('gutenberg_section-field-id', 'Re-Enable Guternberg?', 'my_settings_field_callback', 'reading', 'gutenberg_section');
     40    }
     41     
     42    function my_settings_sanitize( $input ){
     43        return isset( $input ) ? true : false;
     44    }
     45     
     46    function gutenberg_settings(){
     47        echo wpautop( "By Installing this plugin, guternberg will automatically disabled. Check this button if you want to re-enable Gutenberg to your theme." );
     48    }
     49
     50    function my_settings_field_callback(){
     51        ?>
     52        <label for="guternfield"> <input id="guternfield" type="checkbox" value="1" name="reenable-guternberg" <?php checked( get_option( 'reenable-guternberg', true ) ); ?>> "Yes"</label>
     53        <?php
     54    }
     55
    3256    return $removeGutenberg = new removeGutenberg();
    3357}
Note: See TracChangeset for help on using the changeset viewer.