Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/16/2015 06:45:32 AM (10 years ago)
Author:
netweb
Message:

Forums: Updated PHPDocs and unit tests for bbp_update_forum_last_*() functions.

Props thebrandonallen. Fixes #2811

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r5908 r5918  
    12531253 * Update the forum last topic id
    12541254 *
    1255  * @since bbPress (r2625)
    1256  *
    1257  * @param int $forum_id Optional. Forum id
    1258  * @param int $topic_id Optional. Topic id
     1255 * @since 2.0.0 bbPress (r2625)
     1256 *
     1257 * @param int $forum_id Optional. Forum id.
     1258 * @param int $topic_id Optional. Topic id.
    12591259 * @uses bbp_get_forum_id() To get the forum id
    12601260 * @uses bbp_forum_query_subforum_ids() To get the subforum ids
    12611261 * @uses bbp_update_forum_last_topic_id() To update the last topic id of child
    12621262 *                                         forums
     1263 * @uses bbp_get_topic_post_type() To get the topic post type
    12631264 * @uses get_posts() To get the most recent topic in the forum
     1265 * @uses bbp_is_topic_published() To check if the topic is published
    12641266 * @uses update_post_meta() To update the forum's last active id meta
    12651267 * @uses apply_filters() Calls 'bbp_update_forum_last_topic_id' with the last
    1266  *                        reply id and forum id
    1267  * @return bool True on success, false on failure
     1268 *                        topic id and forum id
     1269 * @return int Id of the forums most recent topic
    12681270 */
    12691271function bbp_update_forum_last_topic_id( $forum_id = 0, $topic_id = 0 ) {
     
    13211323 * Update the forum last reply id
    13221324 *
    1323  * @since bbPress (r2625)
    1324  *
    1325  * @param int $forum_id Optional. Forum id
    1326  * @param int $reply_id Optional. Reply id
     1325 * @since 2.0.0 bbPress (r2625)
     1326 *
     1327 * @param int $forum_id Optional. Forum id.
     1328 * @param int $reply_id Optional. Reply id.
    13271329 * @uses bbp_get_forum_id() To get the forum id
    13281330 * @uses bbp_forum_query_subforum_ids() To get the subforum ids
     
    13351337 * @uses apply_filters() Calls 'bbp_update_forum_last_reply_id' with the last
    13361338 *                        reply id and forum id
    1337  * @return bool True on success, false on failure
     1339 * @return int Id of the forums most recent reply
    13381340 */
    13391341function bbp_update_forum_last_reply_id( $forum_id = 0, $reply_id = 0 ) {
     
    13861388 * Update the forum last active post id
    13871389 *
    1388  * @since bbPress (r2860)
    1389  *
    1390  * @param int $forum_id Optional. Forum id
    1391  * @param int $active_id Optional. Active post id
     1390 * @since 2.0.0 bbPress (r2860)
     1391 *
     1392 * @param int $forum_id Optional. Forum id.
     1393 * @param int $active_id Optional. Active post id.
    13921394 * @uses bbp_get_forum_id() To get the forum id
    13931395 * @uses bbp_forum_query_subforum_ids() To get the subforum ids
     
    13961398 * @uses bbp_forum_query_topic_ids() To get the topic ids in the forum
    13971399 * @uses bbp_forum_query_last_reply_id() To get the forum's last reply id
     1400 * @uses bbp_get_public_status_id() To get the public status id
    13981401 * @uses get_post_status() To make sure the reply is published
    13991402 * @uses update_post_meta() To update the forum's last active id meta
    14001403 * @uses apply_filters() Calls 'bbp_update_forum_last_active_id' with the last
    14011404 *                        active post id and forum id
    1402  * @return bool True on success, false on failure
     1405 * @return int Id of the forums last active post
    14031406 */
    14041407function bbp_update_forum_last_active_id( $forum_id = 0, $active_id = 0 ) {
     
    14521455 * Update the forums last active date/time (aka freshness)
    14531456 *
    1454  * @since bbPress (r2680)
    1455  *
    1456  * @param int $forum_id Optional. Topic id
    1457  * @param string $new_time Optional. New time in mysql format
     1457 * @since 2.0.0 bbPress (r2680)
     1458 *
     1459 * @param int    $forum_id Optional. Topic id.
     1460 * @param string $new_time Optional. New time in mysql format.
    14581461 * @uses bbp_get_forum_id() To get the forum id
    14591462 * @uses bbp_get_forum_last_active_id() To get the forum's last post id
     
    14621465 * @uses apply_filters() Calls 'bbp_update_forum_last_active' with the new time
    14631466 *                        and forum id
    1464  * @return bool True on success, false on failure
     1467 * @return string MySQL timestamp of last active topic or reply
    14651468 */
    14661469function bbp_update_forum_last_active_time( $forum_id = 0, $new_time = '' ) {
     
    14771480    }
    14781481
    1479     return (int) apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id );
     1482    return apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id );
    14801483}
    14811484
Note: See TracChangeset for help on using the changeset viewer.