Changeset 9383 for trunk/src/bp-forums/bp-forums-functions.php
- Timestamp:
- 01/21/2015 12:13:52 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-forums/bp-forums-functions.php (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-functions.php
r9351 r9383 80 80 */ 81 81 function bp_forums_get_forum( $forum_id ) { 82 83 /** This action is documented in bp-forums/bp-forums-screens */ 82 84 do_action( 'bbpress_init' ); 83 85 return bb_get_forum( $forum_id ); … … 101 103 */ 102 104 function bp_forums_new_forum( $args = '' ) { 105 106 /** This action is documented in bp-forums/bp-forums-screens */ 103 107 do_action( 'bbpress_init' ); 104 108 … … 133 137 */ 134 138 function bp_forums_update_forum( $args = '' ) { 139 140 /** This action is documented in bp-forums/bp-forums-screens */ 135 141 do_action( 'bbpress_init' ); 136 142 … … 158 164 159 165 if ( !empty( $forum_id ) && is_int( $forum_id ) ) { 166 167 /** This action is documented in bp-forums/bp-forums-screens */ 160 168 do_action( 'bbpress_init' ); 161 169 bb_delete_forum( $forum_id ); … … 189 197 */ 190 198 function bp_forums_get_forum_topics( $args = '' ) { 199 200 /** This action is documented in bp-forums/bp-forums-screens */ 191 201 do_action( 'bbpress_init' ); 192 202 … … 231 241 } 232 242 243 /** 244 * Filters the found forum topics for provided arguments. 245 * 246 * @since BuddyPress (1.1.0) 247 * 248 * @param array $topics Array of found topics. Passed by reference. 249 * @param array $r Array of parsed arguments for query. Passed by reference. 250 */ 233 251 return apply_filters_ref_array( 'bp_forums_get_forum_topics', array( &$topics, &$r ) ); 234 252 } … … 241 259 */ 242 260 function bp_forums_get_topic_details( $topic_id ) { 261 262 /** This action is documented in bp-forums/bp-forums-screens */ 243 263 do_action( 'bbpress_init' ); 244 264 … … 257 277 */ 258 278 function bp_forums_get_topic_id_from_slug( $topic_slug ) { 279 280 /** This action is documented in bp-forums/bp-forums-screens */ 259 281 do_action( 'bbpress_init' ); 260 282 … … 296 318 global $bp; 297 319 320 /** This action is documented in bp-forums/bp-forums-screens */ 298 321 do_action( 'bbpress_init' ); 299 322 … … 335 358 return false; 336 359 360 /** 361 * Fires after a new forum topic has been created. 362 * 363 * @since BuddyPress (1.0.0) 364 * 365 * @param int $topic_id ID of the newly created topic post. 366 */ 337 367 do_action( 'bp_forums_new_topic', $topic_id ); 338 368 … … 355 385 */ 356 386 function bp_forums_update_topic( $args = '' ) { 387 388 /** This action is documented in bp-forums/bp-forums-screens */ 357 389 do_action( 'bbpress_init' ); 358 390 … … 386 418 387 419 function bp_forums_sticky_topic( $args = '' ) { 420 421 /** This action is documented in bp-forums/bp-forums-screens */ 388 422 do_action( 'bbpress_init' ); 389 423 … … 413 447 */ 414 448 function bp_forums_openclose_topic( $args = '' ) { 449 450 /** This action is documented in bp-forums/bp-forums-screens */ 415 451 do_action( 'bbpress_init' ); 416 452 … … 438 474 */ 439 475 function bp_forums_delete_topic( $args = '' ) { 476 477 /** This action is documented in bp-forums/bp-forums-screens */ 440 478 do_action( 'bbpress_init' ); 441 479 … … 456 494 global $bbdb; 457 495 496 /** This action is documented in bp-forums/bp-forums-screens */ 458 497 do_action( 'bbpress_init' ); 459 498 … … 472 511 } 473 512 513 /** 514 * Filters the total topic count for the site. 515 * 516 * @since BuddyPress (1.5.0) 517 * 518 * @param int $count Total topic count. 519 */ 474 520 return apply_filters( 'bp_forums_total_topic_count', $count ); 475 521 } … … 492 538 493 539 if ( $text && $topic_id && $user_id ) { 540 541 /** This action is documented in bp-forums/bp-forums-screens */ 494 542 do_action( 'bbpress_init' ); 495 543 … … 513 561 } 514 562 563 /** 564 * Filters whether a user has already left this particular reply on a given post. 565 * 566 * @since BuddyPress (1.6.0) 567 * 568 * @param bool $reply_exists Whether or not a reply exists. 569 * @param string $text The text of the comment. 570 * @param int $topic_id The topic ID. 571 * @param int $user_id The user ID. 572 */ 515 573 return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id ); 516 574 } … … 540 598 */ 541 599 function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) { 600 601 /** This action is documented in bp-forums/bp-forums-screens */ 542 602 do_action( 'bbpress_init' ); 543 603 … … 579 639 */ 580 640 function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) { 641 642 /** This action is documented in bp-forums/bp-forums-screens */ 581 643 do_action( 'bbpress_init' ); 582 644 … … 610 672 } 611 673 674 /** 675 * Filters the total number of topics replied to by a given user. 676 * 677 * @since BuddyPress (1.5.0) 678 * 679 * @param int $count Total number of topics replied to by a given user. 680 * @param int $user_id The user ID. 681 */ 612 682 return apply_filters( 'bp_forums_total_replied_count_for_user', $count, $user_id ); 613 683 } … … 694 764 */ 695 765 function bp_forums_get_topic_posts( $args = '' ) { 766 767 /** This action is documented in bp-forums/bp-forums-screens */ 696 768 do_action( 'bbpress_init' ); 697 769 … … 718 790 */ 719 791 function bp_forums_get_post( $post_id ) { 792 793 /** This action is documented in bp-forums/bp-forums-screens */ 720 794 do_action( 'bbpress_init' ); 721 795 return bb_get_post( $post_id ); … … 733 807 */ 734 808 function bp_forums_delete_post( $args = '' ) { 809 810 /** This action is documented in bp-forums/bp-forums-screens */ 735 811 do_action( 'bbpress_init' ); 736 812 … … 764 840 */ 765 841 function bp_forums_insert_post( $args = '' ) { 842 843 /** This action is documented in bp-forums/bp-forums-screens */ 766 844 do_action( 'bbpress_init' ); 767 845 … … 803 881 $post_id = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) ); 804 882 805 if ( !empty( $post_id ) ) 883 if ( !empty( $post_id ) ) { 884 885 /** 886 * Fires if there was a new post created. 887 * 888 * @since BuddyPress (1.0.0) 889 * 890 * @param int $post_id ID of the newly created forum post. 891 */ 806 892 do_action( 'bp_forums_new_post', $post_id ); 893 } 807 894 808 895 return $post_id; … … 854 941 } 855 942 943 /** 944 * Filters BP-specific details about a set of posts. 945 * 946 * @since BuddyPress (1.5.0) 947 * 948 * @param array $posts Array of posts holding BP-specific details. 949 */ 856 950 return apply_filters( 'bp_forums_get_post_extras', $posts ); 857 951 } … … 867 961 global $wpdb, $bbdb; 868 962 963 /** This action is documented in bp-forums/bp-forums-screens */ 869 964 do_action( 'bbpress_init' ); 870 965 … … 906 1001 */ 907 1002 function bp_forums_parent_forum_id() { 1003 1004 /** 1005 * Filters the parent forum ID for the bbPress abstraction layer. 1006 * 1007 * @since BuddyPress (1.5.0) 1008 * 1009 * @param int BP_FORUMS_PARENT_FORUM_ID The Parent forum ID constant. 1010 */ 908 1011 return apply_filters( 'bp_forums_parent_forum_id', BP_FORUMS_PARENT_FORUM_ID ); 909 1012 } … … 921 1024 */ 922 1025 function bp_forums_enable_global_directory_stickies() { 1026 1027 /** 1028 * Filters whether or not sticky topics should be broken out of regular topic order. 1029 * 1030 * @since BuddyPress (1.5.0) 1031 * 1032 * @param bool $value Whether or not to break out of topic order. 1033 */ 923 1034 return apply_filters( 'bp_forums_enable_global_directory_stickies', defined( 'BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES' ) && BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES ); 924 1035 } … … 965 1076 * 966 1077 * @package BuddyPress_Forums 967 * @since BuddyPress (1.5 )1078 * @since BuddyPress (1.5.0) 968 1079 */ 969 1080 function bp_embed_forum_cache( $cache, $id, $cachekey ) {
Note: See TracChangeset
for help on using the changeset viewer.