🔥 HOT: Changeset/ - Full Archive

Changeset 615824


Ignore:
Timestamp:
10/22/2012 10:30:41 PM (13 years ago)
Author:
Messenlehner
Message:

v 4.0.0

Location:
bp-registration-options/trunk
Files:
9 added
3 edited

Legend:

Unmodified
Added
Removed
  • bp-registration-options/trunk/bp-registration-options.php

    r298940 r615824  
    11<?php
    2 //ADD BUDDYPRESS MENU ITEM FOR 'Registration Options'
    32
    4 function bprwg_admin_menu() {
     3class BP_Registration_Options {
     4    function __construct() {
     5        // Define plugin constants
     6        $this->version = BP_REGISTRATION_OPTIONS_VERSION;
     7        $this->basename = plugin_basename( __FILE__ );
     8        $this->directory_path = plugin_dir_path( __FILE__ );
     9        $this->directory_url = plugins_url( 'bp-registration-options/' );
    510
    6     if ( !is_site_admin() )
     11        register_activation_hook( __FILE__, array( $this, 'activate' ) ); // plugin activation actions
     12        register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) );
    713
    8         return false;
    914
    10     add_submenu_page( 'bp-general-settings', __( 'Registration Options', 'bprwg'), __( 'Registration Options', 'bprwg' ), 'administrator', 'bp-registration-options', 'bprwg_admin_screen' );
     15        require_once( $this->directory_path . 'includes/admin.php' );
     16        require_once( $this->directory_path . 'includes/core.php' );
     17    }
     18   
     19    /**
     20     * Activation hook for the plugin.
     21     *
     22     *
     23     *
     24     */
     25    function activate() {
     26        $this->includes();
    1127
     28        //verify user is running WP 3.0 or newer
     29        if ( version_compare( get_bloginfo( 'version' ), '3.0', '<' ) ) {
     30            deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate our plugin
     31            wp_die( 'This plugin requires WordPress version 3.0 or higher.' );
     32        }
     33        flush_rewrite_rules();
     34    }
     35
     36    /**
     37     * Deactivation hook for the plugin.
     38     *
     39     *
     40     *
     41     */
     42    function deactivate() {
     43        global $wp_rewrite;
     44        flush_rewrite_rules();
     45    }
    1246}
    1347
    14 add_action( 'admin_menu', 'bprwg_admin_menu' );
    15 
    16 
    17 
    18 //ADMIN SETTINGS PAGE
    19 
    20 function bprwg_admin_screen() {
    21 
    22     global $wpdb, $bp, $iprefix;
    23    
    24     switch_to_blog(1);
    25