Changeset 615824
- Timestamp:
- 10/22/2012 10:30:41 PM (13 years ago)
- Location:
- bp-registration-options/trunk
- Files:
-
- 9 added
- 3 edited
-
bp-registration-options.php (modified) (1 diff)
-
images (added)
-
images/WDS-150x150.png (added)
-
images/facebook-icon.png (added)
-
images/google-icon.png (added)
-
images/twitter-icon.png (added)
-
images/webdevstudios-16x16.png (added)
-
includes (added)
-
includes/admin.php (added)
-
includes/core.php (added)
-
loader.php (modified) (1 diff)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bp-registration-options/trunk/bp-registration-options.php
r298940 r615824 1 1 <?php 2 //ADD BUDDYPRESS MENU ITEM FOR 'Registration Options'3 2 4 function bprwg_admin_menu() { 3 class 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/' ); 5 10 6 if ( !is_site_admin() ) 11 register_activation_hook( __FILE__, array( $this, 'activate' ) ); // plugin activation actions 12 register_deactivation_hook( __FILE__, array( $this, 'deactivate' ) ); 7 13 8 return false;9 14 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(); 11 27 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 } 12 46 } 13 47 14 add_action( 'admin_menu', 'bprwg_admin_menu' );15 16 17 18 //ADMIN SETTINGS PAGE19 20 function bprwg_admin_screen() {21 22 global $wpdb, $bp, $iprefix;23 24 switch_to_blog(1);25