Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/03/2012 12:33:13 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Theme Compatibility:

  • First pass at including theme compatibility into BuddyPress.
  • Introduce dependency, theme-compatibility, template-loader files into Core component.
  • Add theme compatibility classes for components with direct template access.
  • Move actions and filters around for improved plugin dependency.
  • Remove old $bbp references.
  • Turn $bp global into byref singleton, and include methods for setting up theme compatibility. (Fixes #4470.)
  • Add is_buddypress() function to bp-core-template.php.
  • Rename incorrectly named bp_after_theme_setup sub-action.
  • See: #3741.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-filters.php

    r6034 r6285  
    11<?php
     2
     3/**
     4 * BuddyPress Filters
     5 *
     6 * @package BuddyPress
     7 * @subpackage Core
     8 *
     9 * This file contains the filters that are used through-out BuddyPress. They are
     10 * consolidated here to make searching for them easier, and to help developers
     11 * understand at a glance the order in which things occur.
     12 *
     13 * There are a few common places that additional filters can currently be found
     14 *
     15 *  - BuddyPress: In {@link BuddyPress::setup_actions()} in buddypress.php
     16 *  - Component: In {@link BP_Component::setup_actions()} in
     17 *                bp-core/bp-core-component.php
     18 *  - Admin: More in {@link BP_Admin::setup_actions()} in
     19 *            bp-core/bp-core-admin.php
     20 *
     21 * @see bp-core-actions.php
     22 */
    223
    324// Exit if accessed directly
    425if ( !defined( 'ABSPATH' ) ) exit;
     26
     27/**
     28 * Attach BuddyPress to WordPress
     29 *
     30 * BuddyPress uses its own internal actions to help aid in third-party plugin
     31 * development, and to limit the amount of potential future code changes when
     32 * updates to WordPress core occur.
     33 *
     34 * These actions exist to create the concept of 'plugin dependencies'. They
     35 * provide a safe way for plugins to execute code *only* when BuddyPress is
     36 * installed and activated, without needing to do complicated guesswork.
     37 *
     38 * For more information on how this works, see the 'Plugin Dependency' section
     39 * near the bottom of this file.
     40 *
     41 *           v--WordPress Actions       v--BuddyPress Sub-actions
     42 */
     43add_filter( 'request',                 'bp_request',             10    );
     44add_filter( 'template_include',        'bp_template_include',    10    );
     45add_filter( 'login_redirect',          'bp_login_redirect',      10, 3 );
    546
    647// Add some filters to feedback messages
     
    1051add_filter( 'bp_core_render_message_content', 'wpautop'           );
    1152add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
     53
     54/**
     55 * Template Compatibility
     56 *
     57 * If you want to completely bypass this and manage your own custom BuddyPress
     58 * template hierarchy, start here by removing this filter, then look at how
     59 * bp_template_include() works and do something similar. :)
     60 */
     61add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 );
     62add_filter( 'bp_template_include', 'bp_template_include_theme_compat',   4, 2 );
     63
     64// Run all template parts through additional template locations
     65add_filter( 'bp_get_template_part', 'bp_add_template_locations' );
     66
     67// Turn comments off for BuddyPress pages
     68add_filter( 'comments_open', 'bp_comments_open', 10, 2 );
    1269
    1370/**
     
    157214    return bp_get_root_domain();
    158215}
    159 add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 );
     216add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
    160217
    161218/***
     
    358415add_filter( 'bp_modify_page_title', 'convert_chars'   );
    359416add_filter( 'bp_modify_page_title', 'esc_html'        );
    360 
    361 ?>
Note: See TracChangeset for help on using the changeset viewer.