WordPress.org

Plugin Directory

Changeset 607327


Ignore:
Timestamp:
10/03/12 07:11:18 (19 months ago)
Author:
picklewagon
Message:

add some documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-user-approve/trunk/new-user-approve.php

    r607326 r607327  
    7070    } 
    7171 
     72    /** 
     73     * Require WordPress 3.2.1 on activation 
     74     *  
     75     * @uses register_activation_hook 
     76     */ 
    7277    public function activation_check() { 
    7378        global $wp_version; 
     
    8085    } 
    8186 
     87    /** 
     88     * Enqueue any javascript and css needed for the plugin 
     89     */ 
     90    public function init() { 
     91        if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page ) { 
     92            wp_enqueue_script( 'jquery-ui-tabs' ); 
     93            wp_enqueue_style( 'pw-admin-ui-tabs', plugins_url( 'ui.tabs.css', __FILE__ ) ); 
     94        } 
     95    } 
     96     
     97    /** 
     98     * Add the new menu item to the users portion of the admin menu 
     99     */ 
     100    function admin_menu_link() { 
     101        $cap = apply_filters( 'new_user_approve_minimum_cap', 'edit_users' ); 
     102        $this->user_page_hook = add_users_page( __( 'Approve New Users', $this->plugin_id ), __( 'Approve New Users', $this->plugin_id ), $cap, $this->_admin_page, array( $this, 'approve_admin' ) ); 
     103    } 
     104     
     105    /** 
     106     * Output the javascript in the footer to display the tabs 
     107     */ 
    82108    public function admin_scripts_footer() { 
    83109        global $wp_db_version; 
     
    125151 
    126152    /** 
    127      * @desc create the view for the admin interface 
     153     * Create the view for the admin interface 
    128154     */ 
    129155    public function approve_admin() { 
     
    265291 
    266292    /** 
    267      * @desc send an email to the admin to request approval 
     293     * Send an email to the admin to request approval 
    268294     */ 
    269295    public function send_approval_email( $user_login, $user_email, $errors ) { 
     
    296322 
    297323    /** 
    298      * @desc admin approval of user 
     324     * Admin approval of user 
    299325     */ 
    300326    public function approve_user() { 
     
    349375 
    350376    /** 
    351      * @desc admin denial of user 
     377     * Admin denial of user 
    352378     */ 
    353379    public function deny_user() { 
     
    407433 
    408434    /** 
    409      * @desc accept input from admin to modify a user 
     435     * Accept input from admin to modify a user 
    410436     */ 
    411437    public function process_input() { 
     
    426452 
    427453    /** 
    428      * @desc only give a user their password if they have been approved 
     454     * Only give a user their password if they have been approved 
    429455     */ 
    430456    public function lost_password() { 
     
    446472    } 
    447473 
     474    /** 
     475     * Add message to login page saying registration is required. 
     476     *  
     477     * @param string $message 
     478     * @return string 
     479     */ 
    448480    public function welcome_user($message) { 
    449481        if ( ! isset( $_GET['action'] ) ) { 
     
    464496    } 
    465497 
    466     public function init() { 
    467         if ( is_admin() && isset( $_GET['page'] ) && $_GET['page'] == $this->_admin_page ) { 
    468             wp_enqueue_script('jquery-ui-tabs'); 
    469             wp_enqueue_style('pw-admin-ui-tabs', plugins_url( 'ui.tabs.css', __FILE__ ) ); 
    470         } 
    471     } 
    472  
    473     function admin_menu_link() { 
    474         $cap = apply_filters( 'new_user_approve_minimum_cap', 'edit_users' ); 
    475         $this->user_page_hook = add_users_page( __( 'Approve New Users', $this->plugin_id ), __( 'Approve New Users', $this->plugin_id ), $cap, $this->_admin_page, array( $this, 'approve_admin' ) ); 
    476     } 
    477  
     498    /** 
     499     * Determine if the user is good to sign inbased on their status 
     500     *  
     501     * @param array $userdata 
     502     * @param string $password 
     503     */ 
    478504    public function authenticate_user( $userdata, $password ) { 
    479505        $status = get_user_meta( $userdata->ID, 'pw_user_status', true ); 
     
    506532    } 
    507533 
     534    /** 
     535     * Give the user a status 
     536     * @param int $user_id 
     537     */ 
    508538    public function add_user_status( $user_id ) { 
    509539        $status = 'pending'; 
Note: See TracChangeset for help on using the changeset viewer.