Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/27/2011 10:18:38 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Add _insert_ functions for forums, topics, and replies. Audit (forum/topic/hidden) meta key and updater function names and and normalize them where needed.

(Existing installs will need to run recounts, or let them adjust themselves naturally as new topics and replies come in.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-forum-template.php

    r3344 r3349  
    10631063     * @uses bbp_get_forum_permalink() To get the forum permalink
    10641064     * @uses remove_query_arg() To remove args from the url
    1065      * @uses bbp_get_forum_hidden_topic_count() To get the forum hidden
     1065     * @uses bbp_get_forum_topic_count_hidden() To get the forum hidden
    10661066     *                                           topic count
    10671067     * @uses current_user_can() To check if the current user can edit others
     
    10871087
    10881088        // This forum has hidden topics
    1089         if ( current_user_can( 'edit_others_topics' ) && ( $deleted = bbp_get_forum_hidden_topic_count( $forum_id ) ) ) {
     1089        if ( current_user_can( 'edit_others_topics' ) && ( $deleted = bbp_get_forum_topic_count_hidden( $forum_id ) ) ) {
    10901090
    10911091            // Extra text
     
    11621162    function bbp_get_forum_topic_count( $forum_id = 0, $total_count = true ) {
    11631163        $forum_id = bbp_get_forum_id( $forum_id );
    1164         $topics   = get_post_meta( $forum_id, empty( $total_count ) ? '_bbp_forum_topic_count' : '_bbp_total_topic_count', true );
     1164        $topics   = get_post_meta( $forum_id, empty( $total_count ) ? '_bbp_topic_count' : '_bbp_total_topic_count', true );
    11651165
    11661166        return apply_filters( 'bbp_get_forum_topic_count', (int) $topics, $forum_id );
     
    12411241 *
    12421242 * @param int $forum_id Optional. Topic id
    1243  * @uses bbp_get_forum_hidden_topic_count() To get the forum hidden topic count
    1244  */
    1245 function bbp_forum_hidden_topic_count( $forum_id = 0 ) {
    1246     echo bbp_get_forum_hidden_topic_count( $forum_id );
     1243 * @uses bbp_get_forum_topic_count_hidden() To get the forum hidden topic count
     1244 */
     1245function bbp_forum_topic_count_hidden( $forum_id = 0 ) {
     1246    echo bbp_get_forum_topic_count_hidden( $forum_id );
    12471247}
    12481248    /**
     
    12551255     * @uses bbp_get_forum_id() To get the forum id
    12561256     * @uses get_post_meta() To get the hidden topic count
    1257      * @uses apply_filters() Calls 'bbp_get_forum_hidden_topic_count' with
     1257     * @uses apply_filters() Calls 'bbp_get_forum_topic_count_hidden' with
    12581258     *                        the hidden topic count and forum id
    12591259     * @return int Topic hidden topic count
    12601260     */
    1261     function bbp_get_forum_hidden_topic_count( $forum_id = 0 ) {
     1261    function bbp_get_forum_topic_count_hidden( $forum_id = 0 ) {
    12621262        $forum_id = bbp_get_forum_id( $forum_id );
    12631263        $topics   = get_post_meta( $forum_id, '_bbp_topic_count_hidden', true );
    12641264
    1265         return apply_filters( 'bbp_get_forum_hidden_topic_count', (int) $topics, $forum_id );
     1265        return apply_filters( 'bbp_get_forum_topic_count_hidden', (int) $topics, $forum_id );
    12661266    }
    12671267
Note: See TracChangeset for help on using the changeset viewer.