Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/08/2017 02:09:08 PM (8 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/core/options.php

    r6705 r6751  
    263263    }
    264264
    265     // Bail if strategy is overloaded to false|null
    266     $strategy = apply_filters( 'bbp_pre_load_options', 'notoptions' );
    267     if ( empty( $strategy ) ) {
    268         return;
     265    // Maybe intercept
     266    $intercept = bbp_maybe_intercept( __FUNCTION__, 'notoptions' );
     267    if ( bbp_is_intercepted( $intercept ) ) {
     268        return $intercept;
    269269    }
    270270
Note: See TracChangeset for help on using the changeset viewer.