Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/15/2015 02:33:11 AM (11 years ago)
Author:
johnjamesjacoby
Message:

All: Update default values for $args parameters from empty strings to empty arrays.

This is a micro-optimization to avoid unnecessary calls to wp_parse_str() inside bbp_parse_args().

File:
1 edited

Legend:

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

    r5637 r5676  
    102102 * @since bbPress (r2464)
    103103 *
    104  * @param mixed $args All the arguments supported by {@link WP_Query}
     104 * @param array $args All the arguments supported by {@link WP_Query}
    105105 * @uses WP_Query To make query and get the forums
    106106 * @uses bbp_get_forum_post_type() To get the forum post type id
     
    114114 * @return object Multidimensional array of forum information
    115115 */
    116 function bbp_has_forums( $args = '' ) {
     116function bbp_has_forums( $args = array() ) {
    117117
    118118    // Forum archive only shows root
     
    677677 * @since bbPress (r2747)
    678678 *
    679  * @param mixed $args All the arguments supported by {@link WP_Query}
     679 * @param array $args All the arguments supported by {@link WP_Query}
    680680 * @uses bbp_get_forum_id() To get the forum id
    681681 * @uses current_user_can() To check if the current user is capable of
     
    686686 * @return mixed false if none, array of subs if yes
    687687 */
    688 function bbp_forum_get_subforums( $args = '' ) {
     688function bbp_forum_get_subforums( $args = array() ) {
    689689
    690690    // Use passed integer as post_parent
     
    739739 * Output a list of forums (can be used to list subforums)
    740740 *
    741  * @param mixed $args The function supports these args:
     741 * @param array $args The function supports these args:
    742742 *  - before: To put before the output. Defaults to '<ul class="bbp-forums">'
    743743 *  - after: To put after the output. Defaults to '</ul>'
     
    755755 * @uses bbp_get_forum_reply_count() To get forum reply count
    756756 */
    757 function bbp_list_forums( $args = '' ) {
     757function bbp_list_forums( $args = array() ) {
    758758
    759759    // Define used variables
     
    20362036 * @uses bbp_get_single_forum_description() Return the eventual output
    20372037 */
    2038 function bbp_single_forum_description( $args = '' ) {
     2038function bbp_single_forum_description( $args = array() ) {
    20392039    echo bbp_get_single_forum_description( $args );
    20402040}
     
    20452045     * @since bbPress (r2860)
    20462046     *
    2047      * @param mixed $args This function supports these arguments:
     2047     * @param array $args This function supports these arguments:
    20482048     *  - forum_id: Forum id
    20492049     *  - before: Before the text
     
    20612061     * @return string Filtered forum description
    20622062     */
    2063     function bbp_get_single_forum_description( $args = '' ) {
     2063    function bbp_get_single_forum_description( $args = array() ) {
    20642064
    20652065        // Parse arguments against default values
     
    24252425 * @uses bbp_get_form_forum_type() To get the topic's forum id
    24262426 */
    2427 function bbp_form_forum_type_dropdown( $args = '' ) {
     2427function bbp_form_forum_type_dropdown( $args = array() ) {
    24282428    echo bbp_get_form_forum_type_dropdown( $args );
    24292429}
     
    24432443     * @return string HTML select list for selecting forum type
    24442444     */
    2445     function bbp_get_form_forum_type_dropdown( $args = '' ) {
     2445    function bbp_get_form_forum_type_dropdown( $args = array() ) {
    24462446
    24472447        // Backpat for handling passing of a forum ID as integer
     
    25172517 * @uses bbp_get_form_forum_status() To get the topic's forum id
    25182518 */
    2519 function bbp_form_forum_status_dropdown( $args = '' ) {
     2519function bbp_form_forum_status_dropdown( $args = array() ) {
    25202520    echo bbp_get_form_forum_status_dropdown( $args );
    25212521}
     
    25352535     * @return string HTML select list for selecting forum status
    25362536     */
    2537     function bbp_get_form_forum_status_dropdown( $args = '' ) {
     2537    function bbp_get_form_forum_status_dropdown( $args = array() ) {
    25382538
    25392539        // Backpat for handling passing of a forum ID
     
    26092609 * @uses bbp_get_form_forum_visibility() To get the topic's forum id
    26102610 */
    2611 function bbp_form_forum_visibility_dropdown( $args = '' ) {
     2611function bbp_form_forum_visibility_dropdown( $args = array() ) {
    26122612    echo bbp_get_form_forum_visibility_dropdown( $args );
    26132613}
     
    26272627     * @return string HTML select list for selecting forum visibility
    26282628     */
    2629     function bbp_get_form_forum_visibility_dropdown( $args = '' ) {
     2629    function bbp_get_form_forum_visibility_dropdown( $args = array() ) {
    26302630
    26312631        // Backpat for handling passing of a forum ID
Note: See TracChangeset for help on using the changeset viewer.