Changeset 3143 for branches/plugin/bbp-includes/bbp-shortcodes.php
- Timestamp:
- 05/12/2011 11:31:48 PM (15 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-includes/bbp-shortcodes.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-shortcodes.php
r3132 r3143 19 19 class BBP_Shortcodes { 20 20 21 /** Vars ******************************************************************/ 22 23 /** 24 * @var array Shortcode => function 25 */ 26 var $codes; 27 28 /** Functions *************************************************************/ 29 21 30 /** 22 31 * Add the register_shortcodes action to bbp_init … … 27 36 */ 28 37 function BBP_Shortcodes() { 38 $this->__construct(); 39 } 40 41 /** 42 * Add the register_shortcodes action to bbp_init 43 * 44 * @since bbPress (r3031) 45 * 46 * @uses add_action 47 */ 48 function __construct() { 49 $this->_setup_globals(); 29 50 $this->_add_shortcodes(); 51 } 52 53 /** 54 * Shortcode globals 55 * 56 * @since bbPress (r3143) 57 * @access private 58 */ 59 function _setup_globals() { 60 61 // Setup the shortcodes 62 $this->codes = apply_filters( 'bbp_shortcodes', array( 63 64 /** Forums ********************************************************/ 65 66 // Forum Index 67 'bbp-forum-index' => array( $this, 'display_forum_index' ), 68 69 'bbp-single-forum' => array( $this, 'display_forum' ), 70 71 /** Topics ********************************************************/ 72 73 // Topic index 74 'bbp-topic-index' => array( $this, 'display_topic_index' ), 75 76 // Topic form 77 'bbp-topic-form' => array( $this, 'display_topic_form' ), 78 79 // Specific topic - pass an 'id' attribute 80 'bbp-single-topic' => array( $this, 'display_topic' ), 81 82 /** Topic Tags ****************************************************/ 83 84 // All topic tags in a cloud 85 'bbp-topic-tags' => array( $this, 'display_topic_tags' ), 86 87 // Topics of tag Tag 88 'bbp-topic-tag' => array( $this, 'display_topics_of_tag' ), 89 90 /** Replies *******************************************************/ 91 92 // Reply form 93 'bbp-reply-form' => array( $this, 'display_reply_form' ) 94 ) ); 30 95 } 31 96 … … 40 105 function _add_shortcodes() { 41 106 42 /** Forums ************************************************************/ 43 44 // Forum Index 45 add_shortcode( 'bbp-forum-index', array( $this, 'display_forum_index' ) ); 46 47 // Specific forum - pass an 'id' attribute 48 add_shortcode( 'bbp-single-forum', array( $this, 'display_forum' ) ); 49 50 /** Topics ************************************************************/ 51 52 // Topic index 53 add_shortcode( 'bbp-topic-index', array( $this, 'display_topic_index' ) ); 54 55 // Topic form 56 add_shortcode( 'bbp-topic-form', array( $this, 'display_topic_form' ) ); 57 58 // Specific topic - pass an 'id' attribute 59 add_shortcode( 'bbp-single-topic', array( $this, 'display_topic' ) ); 60 61 /** Topic Tags ********************************************************/ 62 63 // All topic tags in a cloud 64 add_shortcode( 'bbp-topic-tags', array( $this, 'display_topic_tags' ) ); 65 66 // Topics of tag Tag 67 add_shortcode( 'bbp-topic-tag', array( $this, 'display_topics_of_tag' ) ); 68 69 /** Replies ***********************************************************/ 70 71 // Reply form 72 add_shortcode( 'bbp-reply-form', array( $this, 'display_reply_form' ) ); 107 // Loop through the shortcodes 108 foreach( $this->codes as $code => $function ) 109 110 // Add each shortcode 111 add_shortcode( $code, $function ); 73 112 74 113 // Custom shortcodes
Note: See TracChangeset
for help on using the changeset viewer.