Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/01/2011 01:33:09 AM (16 years ago)
Author:
johnjamesjacoby
Message:

Adjustments to login and register forms to improve behavior and functionality.
Various documentation fixes.
Rename _bbp_topic_status meta to _bbp_status, and add migration routine to updater.
Sanity checks on $wp_query in bbp_pre_get_posts.

Fixes #1476, #1493. Props GautamGupta for original diff.

File:
1 edited

Legend:

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

    r2968 r2970  
    1111
    1212/**
    13  * Return the unique ID of the custom post type for topics
     13 * Output the unique ID of the custom post type for topics
    1414 *
    1515 * @since bbPress (r2857)
    1616 *
    17  * @global bbPress $bbp
    18  * @return string
     17 * @uses bbp_get_topic_post_type() To get the topic post type
    1918 */
    2019function bbp_topic_post_type() {
    … …  
    2625         * @since bbPress (r2857)
    2726         *
    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
    3030         */
    3131        function bbp_get_topic_post_type() {
    3232                global $bbp;
     33
    3334                return apply_filters( 'bbp_get_topic_post_type', $bbp->topic_post_type );
    3435        }
    … …  
    4243 *
    4344 * @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 page
    45  * @uses get_the_ID() To get the id
     45 * @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
    4647 * @uses WP_Query To make query and get the topics
    4748 * @uses is_page() To check if it's a page
    4849 * @uses bbp_is_forum() To check if it's a forum
     50 * @uses bbp_get_forum_id() To get the forum id
    4951 * @uses bbp_get_paged() To get the current page value
    5052 * @uses bbp_get_super_stickies() To get the super stickies
    … …  
    284286         * @uses bbp_is_reply_edit() To check if it's a reply edit page
    285287         * @uses bbp_get_reply_topic_edit() To get the reply topic id
     288         * @uses get_post_field() To get the post's post type
    286289         * @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
    288293         */
    289294        function bbp_get_topic_id( $topic_id = 0 ) {
    … …  
    610615         * @uses bbp_get_topic_raw_revision_log() To get the raw revision log
    611616         * @uses bbp_get_topic_author_display_name() To get the topic author
    612          * @uses bbp_get_topic_author_link() To get the topic author link
     617         * @uses bbp_get_author_link() To get the topic author link
    613618         * @uses bbp_convert_date() To convert the date
    614619         * @uses bbp_get_time_since() To get the time in since format
    … …  
    839844 * @uses bbp_get_topic_id() To get the topic id
    840845 * @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.
    842847 */
    843848function bbp_is_topic_trash( $topic_id = 0 ) {
    … …  
    895900         * @uses bbp_is_topic_anonymous() To check if the topic is by an
    896901         *                                 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
    897905         * @uses apply_filters() Calls 'bbp_get_topic_author' with the author
    898906         *                        and topic id
    … …  
    11971205         * @param int $topic_id Optional. Topic id
    11981206         * @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
    12001210         * @uses apply_filters() Calls 'bbp_get_topic_forum_id' with the forum
    1201          *  id and topic id
     1211         *                        id and topic id
    12021212         * @return int Topic forum id
    12031213         */
    … …  
    12201230 * @since bbPress (r2860)
    12211231 *
     1232 * @param int $topic_id Optional. Forum id
    12221233 * @uses bbp_get_topic_last_active_id() To get the topic's last active id
    1223  * @param int $topic_id Optional. Forum id
    12241234 */
    12251235function bbp_topic_last_active_id( $topic_id = 0 ) {
    … …  
    15641574         * @uses apply_filters() Calls 'bbp_get_topic_post_count' with the
    15651575         *                        post count and topic id
    1566          * @return int post count
     1576         * @return int Post count
    15671577         */
    15681578        function bbp_get_topic_post_count( $topic_id = 0 ) {
    … …  
    19271937         * @uses current_user_can() To check if the current user can delete the
    19281938         *                           topic
     1939         * @uses bbp_is_topic_trash() To check if the topic is trashed
    19291940         * @uses bbp_get_topic_status() To get the topic status
    19301941         * @uses add_query_arg() To add custom args to the url
    … …  
    23002311 * @uses bbp_is_topic() To check if it's a topic page
    23012312 * @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
    23022317 */
    23032318function bbp_topic_notices() {
    … …  
    23312346
    23322347        // 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' );
    23412352}
    23422353
    … …  
    24162427 * @since bbPress (r2860)
    24172428 *
     2429 * @param array $args See {@link bbp_get_single_topic_description()}
    24182430 * @uses bbp_get_single_topic_description() Return the eventual output
    2419  *
    2420  * @param arr $args Arguments passed to alter output
    24212431 */
    24222432function bbp_single_topic_description( $args = '' ) {
    … …  
    24292439         * @since bbPress (r2860)
    24302440         *
    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 output
    2443          *
     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
    24442454         * @return string Filtered topic description
    24452455         */
Note: See TracChangeset for help on using the changeset viewer.