Skip to:
Content

bbPress.org

Changeset 4653


Ignore:
Timestamp:
12/25/2012 06:11:19 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_deregister_template_stack(), to allow plugins to manipulate the template stack in real-time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/template-functions.php

    r4630 r4653  
    117117
    118118    // Add location callback to template stack
    119     add_filter( 'bbp_template_stack', $location_callback, (int) $priority );
     119    return add_filter( 'bbp_template_stack', $location_callback, (int) $priority );
     120}
     121
     122/**
     123 * Deregisters a previously registered template stack location.
     124 *
     125 * @since bbPress (r4652)
     126 *
     127 * @param string $location Callback function that returns the
     128 * @param int $priority
     129 * @see bbp_register_template_stack()
     130 */
     131function bbp_deregister_template_stack( $location_callback = '', $priority = 10 ) {
     132
     133    // Bail if no location, or function does not exist
     134    if ( empty( $location_callback ) || ! function_exists( $location_callback ) )
     135        return false;
     136
     137    // Remove location callback to template stack
     138    return remove_filter( 'bbp_template_stack', $location_callback, (int) $priority );
    120139}
    121140
Note: See TracChangeset for help on using the changeset viewer.