Plugin Directory

Changeset 2067904


Ignore:
Timestamp:
04/12/2019 03:59:36 PM (7 years ago)
Author:
digitalarbyter
Message:

added feature to disable auto-saving of posts

Location:
wp-tweaker/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-tweaker/trunk/inc/wp-tweaker-admin.php

    r2067411 r2067904  
    234234            'my-setting-admin',
    235235            'wptweaker_setting_section_loading_time'
     236        );
     237        add_settings_field(
     238            'wptweaker_setting_20',
     239            'Disable auto-saving of posts',
     240            array( $this, 'callback_wptweaker_setting_20' ),
     241            'my-setting-admin',
     242            'wptweaker_setting_section_database'
    236243        );
    237244
     
    278285            $wptweaker_new_input['wptweaker_setting_18'] = absint( $wptweaker_input['wptweaker_setting_18'] );
    279286        if( isset( $wptweaker_input['wptweaker_setting_19'] ) )
    280         $wptweaker_new_input['wptweaker_setting_19'] = absint( $wptweaker_input['wptweaker_setting_19'] );
     287            $wptweaker_new_input['wptweaker_setting_19'] = absint( $wptweaker_input['wptweaker_setting_19'] );
     288        if( isset( $wptweaker_input['wptweaker_setting_20'] ) )
     289            $wptweaker_new_input['wptweaker_setting_20'] = absint( $wptweaker_input['wptweaker_setting_20'] );
    281290        return $wptweaker_new_input;
    282291    }
     
    511520             );
    512521     }
    513 
    514 
     522     public function callback_wptweaker_setting_20()
     523     {
     524         printf(
     525             '<input type="radio" id="wptweaker_setting_20" name="wptweaker_settings[wptweaker_setting_20]" value="0" %s /> off ',
     526             $this->wptweaker_options['wptweaker_setting_20'] == 0  ? "checked" : ''
     527             );
     528         printf(
     529             '<input type="radio" id="wptweaker_setting_20" name="wptweaker_settings[wptweaker_setting_20]" value="1" %s /> on ',
     530             $this->wptweaker_options['wptweaker_setting_20'] == 1  ? "checked" : ''
     531             );
     532     }
    515533
    516534     public static function add_help()
  • wp-tweaker/trunk/readme.txt

    r2067411 r2067904  
    3333* Empty the WP-Trash every 7 days
    3434* Remove query strings from ressources
     35* Disable auto-saving blogs
    3536
    3637All you need to do to control this features/functions is
     
    6465
    6566== Changelog ==
     67
     68= 1.3.2 12.04.19 =
     69* added feature to disable auto-saving of posts
    6670
    6771= 1.3.1 11.04.19 =
  • wp-tweaker/trunk/wp-tweaker.php

    r2067411 r2067904  
    77Plugin Name: WP-Tweaker
    88
    9 Description: This slim plugin removes many (unneeded) standard features from WordPress to give your blog the ultimate performance boost! Currently you can disable 19 WordPress functions each with one mouse click.
    10 Version: 1.3.1
     9Description: This slim plugin removes many (unneeded) standard features from WordPress to give your blog the ultimate performance boost! Currently you can disable 20 WordPress functions each with one mouse click.
     10Version: 1.3.2
    1111Author: digitalarbyter
    1212Author URI:  https://digitalarbyter.de
     
    353518: Empty WP-Trash every 7 days
    363619: Remove query strings
     3720: Disable auto-saving posts
    3738
    3839*/
     
    160161function wptweaker_setting_19()
    161162{
    162   function _remove_script_version ( $some_src ){
     163  function wpt_remove_query_strings ( $some_src ){
    163164    $explode = explode( '?', $some_src );
    164165    return $explode[0];
    165166  }
    166   add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    167   add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
     167  add_filter( 'script_loader_src', 'wpt_remove_query_strings', 15, 1 );
     168  add_filter( 'style_loader_src', 'wpt_remove_query_strings', 15, 1 );
     169}
     170
     171function wptweaker_setting_20()
     172{
     173  function wpt_disableAutoSave()
     174  {
     175    wp_deregister_script('autosave');
     176  }
     177  add_action( 'wp_print_scripts', 'wpt_disableAutoSave' );
    168178}
    169179
Note: See TracChangeset for help on using the changeset viewer.