Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/15/2012 01:49:07 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_parse_args() and pass filter keys into its usages.

  • Parsed args to be passively or aggressively filtered
  • Allows functions that normally require passing parsed $args to instead filter or override results
File:
1 edited

Legend:

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

    r3824 r3840  
    117117        $default = array_merge( $parent_args, $default );
    118118
    119     // Filter the default arguments
    120     $args  = apply_filters( 'bbp_pre_has_replies_query', $args );
    121 
    122119    // Set up topic variables
    123     $bbp_r = wp_parse_args( $args, $default );
    124 
    125     // Filter the replies query to allow just-in-time modifications
    126     $bbp_r = apply_filters( 'bbp_has_replies_query', $bbp_r );
     120    $bbp_r = bbp_parse_args( $args, $default, 'has_replies' );
    127121
    128122    // Extract the query variables
     
    984978            'sep'        => ' '
    985979        );
    986         $r = wp_parse_args( $args, $defaults );
     980        $r = bbp_parse_args( $args, $defaults, 'get_reply_author_link' );
    987981        extract( $r );
    988982
     
    13631357            'links'  => array()
    13641358        );
    1365         $r = wp_parse_args( $args, $defaults );
     1359        $r = bbp_parse_args( $args, $defaults, 'get_reply_admin_links' );
    13661360
    13671361        $r['id'] = bbp_get_reply_id( (int) $r['id'] );
     
    14561450            'edit_text'    => __( 'Edit', 'bbpress' )
    14571451        );
    1458         $r = wp_parse_args( $args, $defaults );
     1452        $r = bbp_parse_args( $args, $defaults, 'get_reply_edit_link' );
    14591453        extract( $r );
    14601454
     
    15781572            'delete_text'  => __( 'Delete',  'bbpress' )
    15791573        );
    1580         $r = wp_parse_args( $args, $defaults );
     1574        $r = bbp_parse_args( $args, $defaults, 'get_reply_trash_link' );
    15811575        extract( $r );
    15821576
     
    16481642            'unspam_text'  => __( 'Unspam', 'bbpress' )
    16491643        );
    1650         $r = wp_parse_args( $args, $defaults );
     1644        $r = bbp_parse_args( $args, $defaults, 'get_reply_spam_link' );
    16511645        extract( $r );
    16521646
     
    17121706            'split_title' => __( 'Split the topic from this reply', 'bbpress' )
    17131707        );
    1714         $r = wp_parse_args( $args, $defaults );
     1708        $r = bbp_parse_args( $args, $defaults, 'get_topic_split_link' );
    17151709        extract( $r );
    17161710
Note: See TracChangeset for help on using the changeset viewer.