Skip to:
Content

bbPress.org

Changeset 5691


Ignore:
Timestamp:
04/20/2015 04:20:34 PM (11 years ago)
Author:
johnjamesjacoby
Message:

All: ensure all URLs are escaped (trunk) and cleanup some phpdoc

Also introduce bbp_dropdown class for dropdowns.

Location:
trunk/src/includes
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/admin.php

    r5676 r5691  
    517517        // Settings page link
    518518        if ( current_user_can( 'bbp_settings_page' ) ) {
    519             $new_links['settings'] = '<a href="' . add_query_arg( array( 'page' => 'bbpress'   ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>';
     519            $new_links['settings'] = '<a href="' . esc_url( add_query_arg( array( 'page' => 'bbpress'   ), admin_url( 'options-general.php' ) ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>';
    520520        }
    521521
    522522        // About page link
    523523        if ( current_user_can( 'bbp_about_page' ) ) {
    524             $new_links['about']    = '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php'          ) ) . '">' . esc_html__( 'About',    'bbpress' ) . '</a>';
     524            $new_links['about']    = '<a href="' . esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php'           ) ) ) . '">' . esc_html__( 'About',    'bbpress' ) . '</a>';
    525525        }
    526526
     
    537537     */
    538538    public function admin_bar_about_link( $wp_admin_bar ) {
    539 
    540539        if ( is_user_logged_in() ) {
    541 
    542540            $wp_admin_bar->add_menu( array(
    543541                'parent' => 'wp-logo',
  • trunk/src/includes/admin/metaboxes.php

    r5566 r5691  
    9797                    if ( current_user_can( 'publish_forums' ) ) {
    9898                        $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) );
    99                         $num  = '<a href="' . $link . '">' . $num  . '</a>';
    100                         $text = '<a href="' . $link . '">' . $text . '</a>';
     99                        $num  = '<a href="' . esc_url( $link ) . '">' . $num  . '</a>';
     100                        $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
    101101                    }
    102102                ?>
     
    114114                    if ( current_user_can( 'publish_topics' ) ) {
    115115                        $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) );
    116                         $num  = '<a href="' . $link . '">' . $num  . '</a>';
    117                         $text = '<a href="' . $link . '">' . $text . '</a>';
     116                        $num  = '<a href="' . esc_url( $link ) . '">' . $num  . '</a>';
     117                        $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
    118118                    }
    119119                ?>
     
    131131                    if ( current_user_can( 'publish_replies' ) ) {
    132132                        $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) );
    133                         $num  = '<a href="' . $link . '">' . $num  . '</a>';
    134                         $text = '<a href="' . $link . '">' . $text . '</a>';
     133                        $num  = '<a href="' . esc_url( $link ) . '">' . $num  . '</a>';
     134                        $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
    135135                    }
    136136                ?>
     
    150150                        if ( current_user_can( 'manage_topic_tags' ) ) {
    151151                            $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
    152                             $num  = '<a href="' . $link . '">' . $num  . '</a>';
    153                             $text = '<a href="' . $link . '">' . $text . '</a>';
     152                            $num  = '<a href="' . esc_url( $link ) . '">' . $num  . '</a>';
     153                            $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
    154154                        }
    155155                    ?>
     
    203203                            $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
    204204                        }
    205                         $num  = '<a href="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num  . '</a>';
    206                         $text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
     205                        $num  = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num  . '</a>';
     206                        $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';
    207207                    ?>
    208208
     
    225225                            $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link );
    226226                        }
    227                         $num  = '<a href="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num  . '</a>';
    228                         $text = '<a class="waiting" href="' . $link . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
     227                        $num  = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num  . '</a>';
     228                        $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';
    229229                    ?>
    230230
     
    244244                        $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress' );
    245245                        $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) );
    246                         $num  = '<a href="' . $link . '">' . $num  . '</a>';
    247                         $text = '<a class="waiting" href="' . $link . '">' . $text . '</a>';
     246                        $num  = '<a href="' . esc_url( $link ) . '">' . $num  . '</a>';
     247                        $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>';
    248248                    ?>
    249249
     
    522522        <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong>
    523523        <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label>
    524         <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_topic_nonce' ); ?>" />
     524        <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_topic_nonce' ) ); ?>" />
    525525    </p>
    526526
     
    587587            <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong>
    588588            <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label>
    589             <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_user_nonce' ); ?>" />
     589            <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ), 'bbp_suggest_user_nonce' ) ); ?>" />
    590590        </p>
    591591
  • trunk/src/includes/admin/replies.php

    r5658 r5691  
    648648     * @uses bbp_get_forum_permalink() To get the forum permalink
    649649     * @uses admin_url() To get the admin url of post.php
    650      * @uses add_query_arg() To add custom args to the url
    651650     * @uses apply_filters() Calls 'reply_topic_forum_row_actions' with an
    652651     *                        array of reply topic forum actions
     
    816815            if ( bbp_get_trash_status_id() === $reply->post_status ) {
    817816                $post_type_object   = get_post_type_object( bbp_get_reply_post_type() );
    818                 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
     817                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
    819818            } elseif ( EMPTY_TRASH_DAYS ) {
    820                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
     819                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
    821820            }
    822821
    823822            if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) {
    824                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
     823                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    825824            } elseif ( bbp_get_spam_status_id() === $reply->post_status ) {
    826825                unset( $actions['trash'] );
  • trunk/src/includes/admin/topics.php

    r5658 r5691  
    740740     * @uses bbp_get_forum_permalink() To get the forum permalink
    741741     * @uses admin_url() To get the admin url of post.php
    742      * @uses add_query_arg() To add custom args to the url
    743742     * @uses bbp_topic_reply_count() To output the topic reply count
    744743     * @uses bbp_topic_voice_count() To output the topic voice count
     
    918917                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";
    919918            } elseif ( EMPTY_TRASH_DAYS ) {
    920                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
     919                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";
    921920            }
    922921
    923922            if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) {
    924                 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
     923                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";
    925924            } elseif ( bbp_get_spam_status_id() === $topic->post_status ) {
    926925                unset( $actions['trash'] );
  • trunk/src/includes/common/functions.php

    r5676 r5691  
    255255 * @param bool $force Override bbp_get_view_all() check
    256256 * @uses current_user_can() To check if the current user can moderate
    257  * @uses add_query_arg() To add args to the url
     257 * @uses add_query_arg() To add 'view' arg to the url
    258258 * @uses apply_filters() Calls 'bbp_add_view_all' with the link and original link
    259259 * @return string The link with 'view=all' appended if necessary
     
    278278 * @param string $original_link Original Link to be modified
    279279 * @uses current_user_can() To check if the current user can moderate
    280  * @uses add_query_arg() To add args to the url
     280 * @uses remove_query_arg() To remove 'view' arg from the url
    281281 * @uses apply_filters() Calls 'bbp_add_view_all' with the link and original link
    282282 * @return string The link with 'view=all' appended if necessary
    283283 */
    284284function bbp_remove_view_all( $original_link = '' ) {
    285     return apply_filters( 'bbp_add_view_all', remove_query_arg( 'view', $original_link ), $original_link );
     285    return apply_filters( 'bbp_remove_view_all', remove_query_arg( 'view', $original_link ), $original_link );
    286286}
    287287
  • trunk/src/includes/common/template.php

    r5685 r5691  
    14481448            // Output-related
    14491449            'select_id'          => 'bbp_forum_id',
     1450            'select_class'       => 'bbp_dropdown',
    14501451            'tab'                => false,
    14511452            'options_only'       => false,
     
    15011502
    15021503            // Open the select tag
    1503             $retval   .= '<select name="' . esc_attr( $r['select_id'] ) . '" id="' . esc_attr( $r['select_id'] ) . '"' . $disabled . $tab . '>' . "\n";
     1504            $retval   .= '<select name="' . esc_attr( $r['select_id'] ) . '" id="' . esc_attr( $r['select_id'] ) . '" class="' . esc_attr( $r['select_class'] ) . '"' . $disabled . $tab . '>' . "\n";
    15041505        }
    15051506
  • trunk/src/includes/forums/template.php

    r5686 r5691  
    12541254     * @uses bbp_get_forum_topic_count() To get the forum topic count
    12551255     * @uses bbp_get_forum_permalink() To get the forum permalink
    1256      * @uses remove_query_arg() To remove args from the url
    12571256     * @uses bbp_get_forum_topic_count_hidden() To get the forum hidden
    12581257     *                                           topic count
    12591258     * @uses current_user_can() To check if the current user can edit others
    12601259     *                           topics
    1261      * @uses add_query_arg() To add custom args to the url
    12621260     * @uses apply_filters() Calls 'bbp_get_forum_topics_link' with the
    12631261     *                        topics link and forum id
  • trunk/src/includes/replies/functions.php

    r5684 r5691  
    15561556 *                    and action
    15571557 * @uses bbp_get_reply_url() To get the reply url
    1558  * @uses add_query_arg() To add custom args to the reply url
    15591558 * @uses bbp_redirect() To redirect to the reply
    15601559 * @uses bbPress::errors:add() To log the error messages
  • trunk/src/includes/replies/template.php

    r5676 r5691  
    16841684
    16851685        // Get the reply to use it's ID and post_parent
    1686         $reply = bbp_get_reply( bbp_get_reply_id( $r['id'] ) );
     1686        $reply = bbp_get_reply( $r['id'] );
    16871687
    16881688        // Bail if no reply or user cannot reply
     
    19721972        ), 'get_reply_edit_link' );
    19731973
    1974         $reply = bbp_get_reply( bbp_get_reply_id( $r['id'] ) );
     1974        $reply = bbp_get_reply( $r['id'] );
    19751975
    19761976        // Bypass check if user has caps
     
    20242024        global $wp_rewrite;
    20252025
    2026         $reply = bbp_get_reply( bbp_get_reply_id( $reply_id ) );
     2026        $reply = bbp_get_reply( $reply_id );
    20272027        if ( empty( $reply ) ) {
    20282028            return;
     
    20992099        ), 'get_reply_trash_link' );
    21002100
    2101         $reply = bbp_get_reply( bbp_get_reply_id( $r['id'] ) );
     2101        $reply = bbp_get_reply( $r['id'] );
    21022102
    21032103        if ( empty( $reply ) || ! current_user_can( 'delete_reply', $reply->ID ) ) {
     
    21702170        ), 'get_reply_spam_link' );
    21712171
    2172         $reply = bbp_get_reply( bbp_get_reply_id( $r['id'] ) );
     2172        $reply = bbp_get_reply( $r['id'] );
    21732173
    21742174        if ( empty( $reply ) || ! current_user_can( 'moderate', $reply->ID ) ) {
     
    23672367        ), 'get_reply_approve_link' );
    23682368
    2369         $reply = bbp_get_reply( bbp_get_reply_id( $r['id'] ) );
     2369        $reply = bbp_get_reply( $r['id'] );
    23702370
    23712371        if ( empty( $reply ) || ! current_user_can( 'moderate', $reply->ID ) ) {
     
    26742674            'show_none'    => sprintf( esc_attr__( '%1$s - %2$s', 'bbpress' ), $topic_id, bbp_get_topic_title( $topic_id ) ),
    26752675            'select_id'    => 'bbp_reply_to',
     2676            'select_class' => 'bbp_dropdown',
    26762677            'exclude'      => $reply_id,
    26772678            'selected'     => $reply_to,
     
    27912792        // Parse arguments against default values
    27922793        $r = bbp_parse_args( $args, array(
    2793             'select_id' => 'bbp_reply_status',
    2794             'tab'       => false,
    2795             'reply_id'  => 0,
    2796             'selected'  => false
     2794            'select_id'    => 'bbp_reply_status',
     2795            'select_class' => 'bbp_dropdown',
     2796            'tab'          => false,
     2797            'reply_id'     => 0,
     2798            'selected'     => false
    27972799        ), 'reply_status_dropdown' );
    27982800
     
    28252827        ob_start(); ?>
    28262828
    2827         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
     2829        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
    28282830
    28292831            <?php foreach ( bbp_get_reply_statuses( $r['reply_id'] ) as $key => $label ) : ?>
  • trunk/src/includes/topics/functions.php

    r5684 r5691  
    20852085 * @uses bbp_get_forum_permalink() To get the forum link
    20862086 * @uses bbp_get_topic_permalink() To get the topic link
    2087  * @uses add_query_arg() To add args to the url
    20882087 * @uses bbp_redirect() To redirect to the topic
    20892088 * @uses bbPress::errors:add() To log the error messages
  • trunk/src/includes/topics/template.php

    r5682 r5691  
    21842184     * @uses bbp_get_topic_reply_count() To get the topic reply count
    21852185     * @uses bbp_get_topic_permalink() To get the topic permalink
    2186      * @uses remove_query_arg() To remove args from the url
    21872186     * @uses bbp_get_topic_reply_count_hidden() To get the topic hidden
    21882187     *                                           reply count
    21892188     * @uses current_user_can() To check if the current user can edit others
    21902189     *                           replies
    2191      * @uses add_query_arg() To add custom args to the url
    21922190     * @uses apply_filters() Calls 'bbp_get_topic_replies_link' with the
    21932191     *                        replies link and topic id
     
    21952193    function bbp_get_topic_replies_link( $topic_id = 0 ) {
    21962194
    2197         $topic    = bbp_get_topic( bbp_get_topic_id( (int) $topic_id ) );
     2195        $topic    = bbp_get_topic( $topic_id );
    21982196        $topic_id = $topic->ID;
    21992197        $replies  = sprintf( _n( '%s reply', '%s replies', bbp_get_topic_reply_count( $topic_id, true ), 'bbpress' ), bbp_get_topic_reply_count( $topic_id ) );
     
    25172515            $r['links'] = apply_filters( 'bbp_topic_admin_links', array(
    25182516                'edit'    => bbp_get_topic_edit_link   ( $r ),
     2517                'merge'   => bbp_get_topic_merge_link  ( $r ),
    25192518                'close'   => bbp_get_topic_close_link  ( $r ),
    25202519                'stick'   => bbp_get_topic_stick_link  ( $r ),
    2521                 'merge'   => bbp_get_topic_merge_link  ( $r ),
    25222520                'trash'   => bbp_get_topic_trash_link  ( $r ),
    25232521                'spam'    => bbp_get_topic_spam_link   ( $r ),
     
    25932591
    25942592        // Get the topic
    2595         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2593        $topic = bbp_get_topic( $r['id'] );
    25962594
    25972595        // Bypass check if user has caps
     
    26442642        global $wp_rewrite;
    26452643
    2646         $topic = bbp_get_topic( bbp_get_topic_id( $topic_id ) );
     2644        $topic = bbp_get_topic( $topic_id );
    26472645        if ( empty( $topic ) ) {
    26482646            return;
     
    27192717        ), 'get_topic_trash_link' );
    27202718
    2721         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2719        $topic = bbp_get_topic( $r['id'] );
    27222720
    27232721        if ( empty( $topic ) || ! current_user_can( 'delete_topic', $topic->ID ) ) {
     
    27892787        ), 'get_topic_close_link' );
    27902788
    2791         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2789        $topic = bbp_get_topic( $r['id'] );
    27922790
    27932791        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    28502848        ), 'get_topic_approve_link' );
    28512849
    2852         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2850        $topic = bbp_get_topic( $r['id'] );
    28532851
    28542852        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    29122910        ), 'get_topic_stick_link' );
    29132911
    2914         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2912        $topic = bbp_get_topic( $r['id'] );
    29152913
    29162914        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    29822980        ), 'get_topic_merge_link' );
    29832981
    2984         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     2982        $topic = bbp_get_topic( $r['id'] );
    29852983
    29862984        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    30403038        ), 'get_topic_spam_link' );
    30413039
    3042         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     3040        $topic = bbp_get_topic( $r['id'] );
    30433041
    30443042        if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {
     
    30903088
    30913089        // Get the reply to use it's ID and post_parent
    3092         $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) );
     3090        $topic = bbp_get_topic( $r['id'] );
    30933091
    30943092        // Bail if no reply or user cannot reply
     
    32843282        $r = bbp_parse_args( $args, array(
    32853283            'select_id'    => 'bbp_stick_topic',
     3284            'select_class' => 'bbp_dropdown',
    32863285            'tab'          => false,
    32873286            'topic_id'     => 0,
     
    33233322        ob_start(); ?>
    33243323
    3325         <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
     3324        <select name="<?php echo esc_attr( $r['select_id'] ); ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
    33263325
    33273326            <?php foreach ( bbp_get_topic_types() as $key => $label ) : ?>
     
    33723371        // Parse arguments against default values
    33733372        $r = bbp_parse_args( $args, array(
    3374             'select_id' => 'bbp_topic_status',
    3375             'tab'       => false,
    3376             'topic_id'  => 0,
    3377             'selected'  => false
     3373            'select_id'    => 'bbp_topic_status',
     3374            'select_class' => 'bbp_dropdown',
     3375            'tab'          => false,
     3376            'topic_id'     => 0,
     3377            'selected'     => false
    33783378        ), 'topic_open_close_select' );
    33793379
     
    34063406        ob_start(); ?>
    34073407
    3408         <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select"<?php echo $tab; ?>>
     3408        <select name="<?php echo esc_attr( $r['select_id'] ) ?>" id="<?php echo esc_attr( $r['select_id'] ); ?>_select" class="<?php echo esc_attr( $r['select_class'] ); ?>"<?php echo $tab; ?>>
    34093409
    34103410            <?php foreach ( bbp_get_topic_statuses( $r['topic_id'] ) as $key => $label ) : ?>
  • trunk/src/includes/users/template.php

    r5676 r5691  
    12291229    // Build the variables to pass into printf()
    12301230    $dismiss_url  = wp_nonce_url( add_query_arg( $args, $user_url ), $nonce );
    1231     $dismiss_link = '<a href="' . $dismiss_url . '">' . esc_html_x( 'Cancel', 'Dismiss pending user email address change', 'bbpress' ) . '</a>';
     1231    $dismiss_link = '<a href="' . esc_url( $dismiss_url ) . '">' . esc_html_x( 'Cancel', 'Dismiss pending user email address change', 'bbpress' ) . '</a>';
    12321232    $coded_email  = '<code>' . esc_html( $new_email['newemail'] ) . '</code>'; ?>
    12331233
Note: See TracChangeset for help on using the changeset viewer.