Plugin Directory

Changeset 225583


Ignore:
Timestamp:
04/05/2010 07:06:26 PM (16 years ago)
Author:
nkuttler
Message:

add reset checkbox

File:
1 edited

Legend:

Unmodified
Added
Removed
  • custom-avatars-for-comments/trunk/inc/admin.php

    r225205 r225583  
    105105    function init() {
    106106        if ( ! get_option ( 'commentavatars' ) )
    107             add_option ( 'commentavatars' , $this->defaults () );
     107            add_option ( 'commentavatars' , $this->defaults() );
    108108        else
    109109            $this->check_upgrade();
     
    139139
    140140    /**
     141     * Reset the plugin config
     142     *
     143     * @return none
     144     * @since 0.2.1.0
     145     */
     146     function restore_defaults() {
     147        $this->options = $this->defaults();
     148        update_option( 'commentavatars', $this->options );
     149     }
     150
     151    /**
    141152     * Add the options page
    142153     *
     
    181192     * @since 0.0.2
    182193     */
    183     function admin_page () { ?>
     194    function admin_page () {
     195        if ( $this->get_option( 'reset' ) === '1' )
     196            $this->restore_defaults(); ?>
    184197        <div id="nkuttler" class="wrap" >
    185198            <h2><?php _e( 'Custom Avatars For Comments', 'custom-avatars-for-comments' ) ?></h2> <?php
     
    313326                    </tr>
    314327
     328                    <tr valign="top">
     329                        <th scope="row"> <?php
     330                            _e( "Reset the form?", 'custom-avatars-for-comments' )?>
     331                        </th>
     332                        <td>
     333                            <input name="commentavatars[reset]" type="checkbox" value="1" />
     334                        </td>
     335                    </tr>
     336
    315337                </table>
    316338
Note: See TracChangeset for help on using the changeset viewer.