bbp_maybe_intercept( string $action = '', array $args = array() )
Allow interception of a method or function call.
Description Description
Parameters Parameters
- $action
-
(Optional) Typically the name of the caller function
Default value: ''
- $args
-
(Optional) Typically the results of caller function func_get_args()
Default value: array()
Return Return
(mixed) Intercept results. Default bbp_default_intercept().
Source Source
File: includes/core/abstraction.php
function bbp_maybe_intercept( $action = '', $args = array() ) { // Backwards compatibility juggle $hook = ( false === strpos( $action, 'pre_' ) ) ? "pre_{$action}" : $action; // Default value $default = bbp_default_intercept(); // Parse args $r = bbp_parse_args( (array) $args, array(), 'maybe_intercept' ); // Bail if no args if ( empty( $r ) ) { return $default; } // Filter $args = array_merge( array( $hook ), $r ); $filtered = call_user_func_array( 'apply_filters', $args ); // Return filtered value, or default if not intercepted return ( $filtered === reset( $r ) ) ? $default : $filtered; }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |