Plugin Directory

Changeset 1914287


Ignore:
Timestamp:
07/24/2018 05:05:02 PM (8 years ago)
Author:
digitalarbyter
Message:

Added two new features: Remove the url-field from comments
and Disable url auto-linking in comments

Location:
wp-tweaker/trunk
Files:
3 edited

Legend:

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

    r1900178 r1914287  
    191191            'Disable post by e-mail function',
    192192            array( $this, 'callback_wptweaker_setting_14' ),
     193            'my-setting-admin',
     194            'wptweaker_setting_section_security'
     195        );
     196        add_settings_field(
     197            'wptweaker_setting_15',
     198            'Remove url-field from comments',
     199            array( $this, 'callback_wptweaker_setting_15' ),
     200            'my-setting-admin',
     201            'wptweaker_setting_section_security'
     202        );
     203        add_settings_field(
     204            'wptweaker_setting_16',
     205            'Disable url auto-linking in comments',
     206            array( $this, 'callback_wptweaker_setting_16' ),
    193207            'my-setting-admin',
    194208            'wptweaker_setting_section_security'
     
    227241        if( isset( $wptweaker_input['wptweaker_setting_14'] ) )
    228242            $wptweaker_new_input['wptweaker_setting_14'] = absint( $wptweaker_input['wptweaker_setting_14'] );
     243        if( isset( $wptweaker_input['wptweaker_setting_15'] ) )
     244            $wptweaker_new_input['wptweaker_setting_15'] = absint( $wptweaker_input['wptweaker_setting_15'] );
     245        if( isset( $wptweaker_input['wptweaker_setting_16'] ) )
     246            $wptweaker_new_input['wptweaker_setting_16'] = absint( $wptweaker_input['wptweaker_setting_16'] );
    229247        return $wptweaker_new_input;
    230248    }
     
    402420             );
    403421     }
     422
     423     public function callback_wptweaker_setting_15()
     424     {
     425         printf(
     426             '<input type="radio" id="wptweaker_setting_15" name="wptweaker_settings[wptweaker_setting_15]" value="0" %s /> off ',
     427             $this->wptweaker_options['wptweaker_setting_15'] == 0  ? "checked" : ''
     428             );
     429         printf(
     430             '<input type="radio" id="wptweaker_setting_15" name="wptweaker_settings[wptweaker_setting_15]" value="1" %s /> on ',
     431             $this->wptweaker_options['wptweaker_setting_15'] == 1  ? "checked" : ''
     432             );
     433     }
     434
     435     public function callback_wptweaker_setting_16()
     436     {
     437         printf(
     438             '<input type="radio" id="wptweaker_setting_16" name="wptweaker_settings[wptweaker_setting_16]" value="0" %s /> off ',
     439             $this->wptweaker_options['wptweaker_setting_16'] == 0  ? "checked" : ''
     440             );
     441         printf(
     442             '<input type="radio" id="wptweaker_setting_16" name="wptweaker_settings[wptweaker_setting_16]" value="1" %s /> on ',
     443             $this->wptweaker_options['wptweaker_setting_16'] == 1  ? "checked" : ''
     444             );
     445     }
    404446}
    405447?>
  • wp-tweaker/trunk/readme.txt

    r1900178 r1914287  
    2828* Disable the XML-RPC
    2929* Remove post by e-mail function
     30* Remove the url-field from comments
     31* Disable url auto-linking in comments
    3032
    3133All you need to do to control this features/functions is
     
    5961
    6062== Changelog ==
     63= 1.2.5 24.7.18 =
     64* added feature to remove the url-field from comments
     65* added feature to disable url auto-linking in comments
     66
    6167= 1.2.4 27.06.18 =
    6268* Fixed typos and added new screenshots
  • wp-tweaker/trunk/wp-tweaker.php

    r1900182 r1914287  
    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 14 WordPress functions each with one mouse click.
    10 Version: 1.2.4
     9Description: This slim plugin removes many (unneeded) standard features from WordPress to give your blog the ultimate performance boost! Currently you can disable 16 WordPress functions each with one mouse click.
     10Version: 1.2.5
    1111Author: digitalarbyter
    1212Author URI:  https://digitalarbyter.de
     
    122122}
    123123
     124function wptweaker_setting_15()
     125{
     126  add_filter('comment_form_default_fields', 'remove_url_field');
     127  function remove_url_field($fields)
     128  {
     129    if(isset($fields['url']))
     130       unset($fields['url']);
     131    return $fields;
     132  }
     133}
     134
     135function wptweaker_setting_16()
     136{
     137  remove_filter('comment_text', 'make_clickable', 9);
     138}
    124139
    125140//Fire!
Note: See TracChangeset for help on using the changeset viewer.