Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/24/2011 02:00:04 PM (15 years ago)
Author:
djpaul
Message:

First pass of Akismet support for the Activity component. See #3660

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-loader.php

    r5109 r5259  
    2525         * @since 1.5.0
    2626         */
    27         function BP_Activity_Component() {
    28                 $this->__construct();
    29         }
    30 
    3127        function __construct() {
    3228                parent::start(
     
    5349                        'notifications',
    5450                );
     51
     52                // Load Akismet support if Akismet is configured
     53                $akismet_key = bp_get_option( 'wordpress_api_key' );
     54                if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) )
     55                        $includes[] = 'akismet';
    5556
    5657                parent::includes( $includes );
     
    308309                parent::setup_title();
    309310        }
     311
     312        /**
     313         * Setup the actions
     314         *
     315         * @since 1.6
     316         */
     317         function setup_actions() {
     318                // Spam prevention
     319                add_action( 'bp_include', 'bp_activity_setup_akismet' );
     320
     321                parent::setup_actions();
     322        }
    310323}
    311324
    312325// Create the activity component
    313326$bp->activity = new BP_Activity_Component();
    314 
    315327?>
Note: See TracChangeset for help on using the changeset viewer.