Permalink
Browse files

Add shortcode registration to the 'init' hook.

git-svn-id: http://svn.locallylost.com/plugins/members/trunk@503 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
1 parent 23f3167 commit 99c5bc16a18fd9b13e8592f40be75f6938507dda greenshady committed Nov 28, 2010
Showing with 15 additions and 6 deletions.
  1. +15 −6 components/shortcodes/shortcodes.php
@@ -10,12 +10,21 @@
*/
/* Add shortcodes. */
-add_shortcode( 'login-form', 'members_login_form_shortcode' );
-add_shortcode( 'access', 'members_access_check_shortcode' );
-add_shortcode( 'feed', 'members_access_check_shortcode' );
-add_shortcode( 'is_user_logged_in', 'members_is_user_logged_in_shortcode' );
-add_shortcode( 'get_avatar', 'members_get_avatar_shortcode' );
-add_shortcode( 'avatar', 'members_get_avatar_shortcode' );
+add_action( 'init', 'members_component_shortcodes_register_shortcodes' );
+
+/**
+ * Registers shortcodes for the shortcodes component.
+ *
+ * @since 0.2.0
+ */
+function members_component_shortcodes_register_shortcodes() {
+ add_shortcode( 'login-form', 'members_login_form_shortcode' );
+ add_shortcode( 'access', 'members_access_check_shortcode' );
+ add_shortcode( 'feed', 'members_access_check_shortcode' );
+ add_shortcode( 'is_user_logged_in', 'members_is_user_logged_in_shortcode' );
+ add_shortcode( 'get_avatar', 'members_get_avatar_shortcode' );
+ add_shortcode( 'avatar', 'members_get_avatar_shortcode' );
+}
/**
* Displays an avatar for any user. At the very least, an ID or email must

0 comments on commit 99c5bc1

Please sign in to comment.