Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created August 12, 2012 04:14
Show Gist options
  • Save evansolomon/3329672 to your computer and use it in GitHub Desktop.
Save evansolomon/3329672 to your computer and use it in GitHub Desktop.
Index: wp-content/mu-plugins/pig-setup.php
===================================================================
--- wp-content/mu-plugins/pig-setup.php (revision 228)
+++ wp-content/mu-plugins/pig-setup.php (working copy)
@@ -21,7 +21,7 @@
pig_register_question( 'Additional Comments', '%s waxes poetic about food…', false );
pig_register_question( 'What are some topics you are good at speaking about?', '%s knows a bit about…', false );
}
-add_action( 'bp_init', 'a8c_pig_setup_questions' );
+add_action( 'pig_loaded', 'a8c_pig_setup_questions' );
// Automatticians only
add_filter( 'pig_group_id', function() { return 1; } );
Index: wp-content/mu-plugins/pig.php
===================================================================
--- wp-content/mu-plugins/pig.php (revision 228)
+++ wp-content/mu-plugins/pig.php (working copy)
@@ -1,5 +1,28 @@
<?php
-require dirname( __FILE__ ) . '/pig/admin-bar.php';
-require dirname( __FILE__ ) . '/pig/ajax-handler.php';
-require dirname( __FILE__ ) . '/pig/questions.php';
+/*
+Plugin Name: P.I.G. (Personal Information Game)
+Plugin URI: http://buddypig.com
+Description: Personal Information Game. Use profile information in BuddyPress to create a quiz game about other members in a group.
+Version: 1.0
+Author: Evan Solomon, Beau Lebens
+*/
+
+function pig_loader() {
+ // Makes questions and checks answers
+ require dirname( __FILE__ ) . '/pig/questions.php';
+
+ // Creates the button
+ require dirname( __FILE__ ) . '/pig/admin-bar.php';
+ // Handles AJAX interaction
+ require dirname( __FILE__ ) . '/pig/ajax-handler.php';
+
+ // Adds PIG to the BuddyPress activity filters
+ require dirname( __FILE__ ) . '/pig/activity.php';
+
+ // Keeps track of correct and incorrect answers
+ require dirname( __FILE__ ) . '/pig/scores.php';
+
+ do_action( 'pig_loaded' );
+}
+add_action( 'bp_loaded', 'pig_loader' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment