Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/27/2017 05:04:31 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Tools: Add //Filter & return note for future discovery of missing filter documentation.

Also adjust some type-casting on filtered results.

File:
1 edited

Legend:

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

    r6415 r6438  
    2222}
    2323
    24 /**
    25  * Return the URL to run a specific repair tool
    26  *
    27  * @since 2.6.0 bbPress (r5885)
    28  *
    29  * @param string $component
    30  */
    31 function bbp_get_admin_repair_tool_run_url( $component = array() ) {
    32     $tools  = admin_url( 'tools.php' );
    33     $page   = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade';
    34     $args   = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) );
    35     $url    = add_query_arg( $args, $tools );
    36     $nonced = wp_nonce_url( $url, 'bbpress-do-counts' );
    37 
    38     return apply_filters( 'bbp_get_admin_repair_tool_run_url', $nonced, $component );
    39 }
     24    /**
     25     * Return the URL to run a specific repair tool
     26     *
     27     * @since 2.6.0 bbPress (r5885)
     28     *
     29     * @param string $component
     30     */
     31    function bbp_get_admin_repair_tool_run_url( $component = array() ) {
     32        $tools  = admin_url( 'tools.php' );
     33        $page   = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade';
     34        $args   = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) );
     35        $url    = add_query_arg( $args, $tools );
     36        $nonced = wp_nonce_url( $url, 'bbpress-do-counts' );
     37
     38        // Filter & return
     39        return apply_filters( 'bbp_get_admin_repair_tool_run_url', $nonced, $component );
     40    }
    4041
    4142/**
     
    174175    }
    175176
     177    // Filter & return
    176178    return apply_filters( 'bbp_get_admin_repair_tools', $tools, $type );
    177179}
     
    198200    }
    199201
     202    // Filter & return
    200203    return apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval );
    201204}
     
    380383    ksort( $repair_list );
    381384
     385    // Filter & return
    382386    return (array) apply_filters( 'bbp_repair_list', $repair_list );
    383387}
Note: See TracChangeset for help on using the changeset viewer.