Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/08/2017 02:09:08 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Intercept: first pass intercept API.

This change introduces 3 new functions for generating a default intercept value and comparing against it in specific places. If the return value differs from the default intercept value, we know that function call was intercepted by a filter, and that value will become the new return value without executing the remaining part of the function.

See #3184.

File:
1 edited

Legend:

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

    r6737 r6751  
    321321function bbp_add_sticky_topics( &$query, $args = array() ) {
    322322
    323         // Bail if overloaded
    324         if ( null !== apply_filters( 'bbp_pre_add_stick_topics', null, $query, $args ) ) {
    325                 return;
     323        // Bail if intercepted
     324        $intercept = bbp_maybe_intercept( __FUNCTION__, func_get_args() );
     325        if ( bbp_is_intercepted( $intercept ) ) {
     326                return $intercept;
    326327        }
    327328
Note: See TracChangeset for help on using the changeset viewer.