Changeset 2970 for branches/plugin/bbp-includes/bbp-topic-template.php
- Timestamp:
- 04/01/2011 01:33:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-template.php
r2968 r2970 11 11 12 12 /** 13 * Returnthe unique ID of the custom post type for topics13 * Output the unique ID of the custom post type for topics 14 14 * 15 15 * @since bbPress (r2857) 16 16 * 17 * @global bbPress $bbp 18 * @return string 17 * @uses bbp_get_topic_post_type() To get the topic post type 19 18 */ 20 19 function bbp_topic_post_type() { … … 26 25 * @since bbPress (r2857) 27 26 * 28 * @global bbPress $bbp 29 * @return string 27 * @uses apply_filters() Calls 'bbp_get_topic_post_type' with the topic 28 * post type id 29 * @return string The unique topic post type id 30 30 */ 31 31 function bbp_get_topic_post_type() { 32 32 global $bbp; 33 33 34 return apply_filters( 'bbp_get_topic_post_type', $bbp->topic_post_type ); 34 35 } … … 42 43 * 43 44 * @param mixed $args All the arguments supported by {@link WP_Query} 44 * @uses bbp_is_user_profile_page() To check if it's the profile page45 * @uses get_the_ID() To get the id45 * @uses current_user_can() To check if the current user can edit other's topics 46 * @uses bbp_get_topic_post_type() To get the topic post type 46 47 * @uses WP_Query To make query and get the topics 47 48 * @uses is_page() To check if it's a page 48 49 * @uses bbp_is_forum() To check if it's a forum 50 * @uses bbp_get_forum_id() To get the forum id 49 51 * @uses bbp_get_paged() To get the current page value 50 52 * @uses bbp_get_super_stickies() To get the super stickies … … 284 286 * @uses bbp_is_reply_edit() To check if it's a reply edit page 285 287 * @uses bbp_get_reply_topic_edit() To get the reply topic id 288 * @uses get_post_field() To get the post's post type 286 289 * @uses WP_Query::post::ID To get the topic id 287 * @uses apply_filters() Calls 'bbp_get_topic_id' with the topic id 290 * @uses apply_filters() Calls 'bbp_get_topic_id' with the topic id and 291 * supplied topic id 292 * @return int The topic id 288 293 */ 289 294 function bbp_get_topic_id( $topic_id = 0 ) { … … 610 615 * @uses bbp_get_topic_raw_revision_log() To get the raw revision log 611 616 * @uses bbp_get_topic_author_display_name() To get the topic author 612 * @uses bbp_get_ topic_author_link() To get the topic author link617 * @uses bbp_get_author_link() To get the topic author link 613 618 * @uses bbp_convert_date() To convert the date 614 619 * @uses bbp_get_time_since() To get the time in since format … … 839 844 * @uses bbp_get_topic_id() To get the topic id 840 845 * @uses bbp_get_topic_status() To get the topic status 841 * @return bool True if spam, false if not.846 * @return bool True if trashed, false if not. 842 847 */ 843 848 function bbp_is_topic_trash( $topic_id = 0 ) { … … 895 900 * @uses bbp_is_topic_anonymous() To check if the topic is by an 896 901 * anonymous user 902 * @uses bbp_get_topic_author_id() To get the topic author id 903 * @uses get_the_author_meta() To get the display name of the author 904 * @uses get_post_meta() To get the name of the anonymous poster 897 905 * @uses apply_filters() Calls 'bbp_get_topic_author' with the author 898 906 * and topic id … … 1197 1205 * @param int $topic_id Optional. Topic id 1198 1206 * @uses bbp_get_topic_id() To get topic id 1199 * @uses get_post_field() To get get topic's parent 1207 * @uses get_post_meta() To retrieve get topic's forum id meta 1208 * @uses get_post_field() To get the topic's parent, i.e. forum id 1209 * @uses bbp_update_topic_forum_id() To update the topic forum id 1200 1210 * @uses apply_filters() Calls 'bbp_get_topic_forum_id' with the forum 1201 * id and topic id1211 * id and topic id 1202 1212 * @return int Topic forum id 1203 1213 */ … … 1220 1230 * @since bbPress (r2860) 1221 1231 * 1232 * @param int $topic_id Optional. Forum id 1222 1233 * @uses bbp_get_topic_last_active_id() To get the topic's last active id 1223 * @param int $topic_id Optional. Forum id1224 1234 */ 1225 1235 function bbp_topic_last_active_id( $topic_id = 0 ) { … … 1564 1574 * @uses apply_filters() Calls 'bbp_get_topic_post_count' with the 1565 1575 * post count and topic id 1566 * @return int post count1576 * @return int Post count 1567 1577 */ 1568 1578 function bbp_get_topic_post_count( $topic_id = 0 ) { … … 1927 1937 * @uses current_user_can() To check if the current user can delete the 1928 1938 * topic 1939 * @uses bbp_is_topic_trash() To check if the topic is trashed 1929 1940 * @uses bbp_get_topic_status() To get the topic status 1930 1941 * @uses add_query_arg() To add custom args to the url … … 2300 2311 * @uses bbp_is_topic() To check if it's a topic page 2301 2312 * @uses bbp_get_topic_status() To get the topic status 2313 * @uses bbp_get_topic_id() To get the topic id 2314 * @uses apply_filters() Calls 'bbp_topic_notices' with the notice text, topic 2315 * status and topic id 2316 * @uses bbPress::errors::add() To add the notices to the error handler 2302 2317 */ 2303 2318 function bbp_topic_notices() { … … 2331 2346 2332 2347 // Filter notice text and bail if empty 2333 if ( ! $notice_text = apply_filters( 'bbp_topic_notices', $notice_text, $topic_status, bbp_get_topic_id() ) ) 2334 return; ?> 2335 2336 <div class="bbp-template-notice error"> 2337 <p><?php echo $notice_text; ?></p> 2338 </div> 2339 2340 <?php 2348 if ( !$notice_text = apply_filters( 'bbp_topic_notices', $notice_text, $topic_status, bbp_get_topic_id() ) ) 2349 return; 2350 2351 $bbp->errors->add( 'topic_notice', $notice_text, 'message' ); 2341 2352 } 2342 2353 … … 2416 2427 * @since bbPress (r2860) 2417 2428 * 2429 * @param array $args See {@link bbp_get_single_topic_description()} 2418 2430 * @uses bbp_get_single_topic_description() Return the eventual output 2419 *2420 * @param arr $args Arguments passed to alter output2421 2431 */ 2422 2432 function bbp_single_topic_description( $args = '' ) { … … 2429 2439 * @since bbPress (r2860) 2430 2440 * 2431 * @ uses wp_parse_args()2432 * @uses bbp_get_topic_id()2433 * @uses bbp_get_topic_topic_count()2434 * @uses bbp_get_topic_reply_count()2435 * @uses bbp_get_topic_subtopic_count()2436 * @uses bbp_get_topic_ freshness_link()2437 * @uses bbp_get_topic_ last_reply_id()2438 * @uses bbp_get_ reply_author_avatar()2439 * @uses bbp_get_ reply_author_link()2440 * @uses apply_filters()2441 * 2442 * @ param arr $args Arguments passed to alter output2443 * 2441 * @param mixed $args This function supports these arguments: 2442 * - topic_id: Topic id 2443 * - before: Before the text 2444 * - after: After the text 2445 * - size: Size of the avatar 2446 * @uses bbp_get_topic_id() To get the topic id 2447 * @uses bbp_get_topic_voice_count() To get the topic voice count 2448 * @uses bbp_get_topic_reply_count() To get the topic reply count 2449 * @uses bbp_get_topic_freshness_link() To get the topic freshness link 2450 * @uses bbp_get_topic_last_active_id() To get the topic last active id 2451 * @uses bbp_get_reply_author_link() To get the reply author link 2452 * @uses apply_filters() Calls 'bbp_get_single_topic_description' with 2453 * the description and args 2444 2454 * @return string Filtered topic description 2445 2455 */
Note: See TracChangeset
for help on using the changeset viewer.