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/replies/template.php

    r5675 r5676  
    9999 * @since bbPress (r2553)
    100100 *
    101  * @param mixed $args All the arguments supported by {@link WP_Query}
     101 * @param array $args All the arguments supported by {@link WP_Query}
    102102 * @uses bbp_show_lead_topic() Are we showing the topic as a lead?
    103103 * @uses bbp_get_topic_id() To get the topic id
     
    119119 * @return object Multidimensional array of reply information
    120120 */
    121 function bbp_has_replies( $args = '' ) {
     121function bbp_has_replies( $args = array() ) {
    122122    global $wp_rewrite;
    123123
     
    12031203 * @since bbPress (r2717)
    12041204 *
    1205  * @param mixed $args Optional. If it is an integer, it is used as reply id.
     1205 * @param array $args Optional. If it is an integer, it is used as reply id.
    12061206 * @uses bbp_get_reply_author_link() To get the reply author link
    12071207 */
    1208 function bbp_reply_author_link( $args = '' ) {
     1208function bbp_reply_author_link( $args = array() ) {
    12091209    echo bbp_get_reply_author_link( $args );
    12101210}
     
    12141214     * @since bbPress (r2717)
    12151215     *
    1216      * @param mixed $args Optional. If an integer, it is used as reply id.
     1216     * @param array $args Optional. If an integer, it is used as reply id.
    12171217     * @uses bbp_get_reply_id() To get the reply id
    12181218     * @uses bbp_is_reply_anonymous() To check if the reply is by an
     
    12281228     * @return string Author link of reply
    12291229     */
    1230     function bbp_get_reply_author_link( $args = '' ) {
     1230    function bbp_get_reply_author_link( $args = array() ) {
    12311231
    12321232        // Parse arguments against default values
     
    19361936 * @since bbPress (r2740)
    19371937 *
    1938  * @param mixed $args See {@link bbp_get_reply_edit_link()}
     1938 * @param array $args See {@link bbp_get_reply_edit_link()}
    19391939 * @uses bbp_get_reply_edit_link() To get the reply edit link
    19401940 */
    1941 function bbp_reply_edit_link( $args = '' ) {
     1941function bbp_reply_edit_link( $args = array() ) {
    19421942    echo bbp_get_reply_edit_link( $args );
    19431943}
     
    19481948     * @since bbPress (r2740)
    19491949     *
    1950      * @param mixed $args This function supports these arguments:
     1950     * @param array $args This function supports these arguments:
    19511951     *  - id: Reply id
    19521952     *  - link_before: HTML before the link
     
    19621962     * @return string Reply edit link
    19631963     */
    1964     function bbp_get_reply_edit_link( $args = '' ) {
     1964    function bbp_get_reply_edit_link( $args = array() ) {
    19651965
    19661966        // Parse arguments against default values
     
    20522052 * @since bbPress (r2740)
    20532053 *
    2054  * @param mixed $args See {@link bbp_get_reply_trash_link()}
     2054 * @param array $args See {@link bbp_get_reply_trash_link()}
    20552055 * @uses bbp_get_reply_trash_link() To get the reply trash link
    20562056 */
    2057 function bbp_reply_trash_link( $args = '' ) {
     2057function bbp_reply_trash_link( $args = array() ) {
    20582058    echo bbp_get_reply_trash_link( $args );
    20592059}
     
    20642064     * @since bbPress (r2740)
    20652065     *
    2066      * @param mixed $args This function supports these arguments:
     2066     * @param array $args This function supports these arguments:
    20672067     *  - id: Reply id
    20682068     *  - link_before: HTML before the link
     
    20862086     * @return string Reply trash link
    20872087     */
    2088     function bbp_get_reply_trash_link( $args = '' ) {
     2088    function bbp_get_reply_trash_link( $args = array() ) {
    20892089
    20902090        // Parse arguments against default values
     
    21282128 * @since bbPress (r2740)
    21292129 *
    2130  * @param mixed $args See {@link bbp_get_reply_spam_link()}
     2130 * @param array $args See {@link bbp_get_reply_spam_link()}
    21312131 * @uses bbp_get_reply_spam_link() To get the reply spam link
    21322132 */
    2133 function bbp_reply_spam_link( $args = '' ) {
     2133function bbp_reply_spam_link( $args = array() ) {
    21342134    echo bbp_get_reply_spam_link( $args );
    21352135}
     
    21402140     * @since bbPress (r2740)
    21412141     *
    2142      * @param mixed $args This function supports these arguments:
     2142     * @param array $args This function supports these arguments:
    21432143     *  - id: Reply id
    21442144     *  - link_before: HTML before the link
     
    21592159     * @return string Reply spam link
    21602160     */
    2161     function bbp_get_reply_spam_link( $args = '' ) {
     2161    function bbp_get_reply_spam_link( $args = array() ) {
    21622162
    21632163        // Parse arguments against default values
     
    21912191 * @since bbPress (r4521)
    21922192 *
    2193  * @param mixed $args See {@link bbp_get_reply_move_link()}
     2193 * @param array $args See {@link bbp_get_reply_move_link()}
    21942194 * @uses bbp_get_reply_move_link() To get the reply move link
    21952195 */
    2196 function bbp_reply_move_link( $args = '' ) {
     2196function bbp_reply_move_link( $args = array() ) {
    21972197    echo bbp_get_reply_move_link( $args );
    21982198}
     
    22052205     * @since bbPress (r4521)
    22062206     *
    2207      * @param mixed $args This function supports these arguments:
     2207     * @param array $args This function supports these arguments:
    22082208     *  - id: Reply id
    22092209     *  - link_before: HTML before the link
     
    22242224     * @return string Reply move link
    22252225     */
    2226     function bbp_get_reply_move_link( $args = '' ) {
     2226    function bbp_get_reply_move_link( $args = array() ) {
    22272227
    22282228        // Parse arguments against default values
     
    22592259 * @since bbPress (r2756)
    22602260 *
    2261  * @param mixed $args See {@link bbp_get_topic_split_link()}
     2261 * @param array $args See {@link bbp_get_topic_split_link()}
    22622262 * @uses bbp_get_topic_split_link() To get the topic split link
    22632263 */
    2264 function bbp_topic_split_link( $args = '' ) {
     2264function bbp_topic_split_link( $args = array() ) {
    22652265    echo bbp_get_topic_split_link( $args );
    22662266}
     
    22732273     * @since bbPress (r2756)
    22742274     *
    2275      * @param mixed $args This function supports these arguments:
     2275     * @param array $args This function supports these arguments:
    22762276     *  - id: Reply id
    22772277     *  - link_before: HTML before the link
     
    22922292     * @return string Topic split link
    22932293     */
    2294     function bbp_get_topic_split_link( $args = '' ) {
     2294    function bbp_get_topic_split_link( $args = array() ) {
    22952295
    22962296        // Parse arguments against default values
     
    23252325 * @since bbPress (r5507)
    23262326 *
    2327  * @param mixed $args See {@link bbp_get_reply_approve_link()}
     2327 * @param array $args See {@link bbp_get_reply_approve_link()}
    23282328 * @uses bbp_get_reply_approve_link() To get the reply approve link
    23292329 */
    2330 function bbp_reply_approve_link( $args = '' ) {
     2330function bbp_reply_approve_link( $args = array() ) {
    23312331    echo bbp_get_reply_approve_link( $args );
    23322332}
     
    23372337     * @since bbPress (r5507)
    23382338     *
    2339      * @param mixed $args This function supports these args:
     2339     * @param array $args This function supports these args:
    23402340     *  - id: Optional. Reply id
    23412341     *  - link_before: Before the link
     
    23552355     * @return string Reply approve link
    23562356     */
    2357     function bbp_get_reply_approve_link( $args = '' ) {
     2357    function bbp_get_reply_approve_link( $args = array() ) {
    23582358
    23592359        // Parse arguments against default values
     
    27692769 *  - selected: Override the selected option
    27702770 */
    2771 function bbp_form_reply_status_dropdown( $args = '' ) {
     2771function bbp_form_reply_status_dropdown( $args = array() ) {
    27722772    echo bbp_get_form_reply_status_dropdown( $args );
    27732773}
     
    27872787     *  - selected: Override the selected option
    27882788     */
    2789     function bbp_get_form_reply_status_dropdown( $args = '' ) {
     2789    function bbp_get_form_reply_status_dropdown( $args = array() ) {
    27902790
    27912791        // Parse arguments against default values
Note: See TracChangeset for help on using the changeset viewer.