Changeset 11102
- Timestamp:
- 09/14/2016 05:06:11 PM (8 years ago)
- Location:
- trunk/src/bp-activity
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-actions.php
r11091 r11102 604 604 } 605 605 add_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); 606 607 /**608 * Loads Akismet filtering for activity.609 *610 * @since 1.6.0611 * @since 2.3.0 We only support Akismet 3+.612 */613 function bp_activity_setup_akismet() {614 $bp = buddypress();615 616 // Bail if Akismet is not active.617 if ( ! defined( 'AKISMET_VERSION' ) ) {618 return;619 }620 621 // Bail if older version of Akismet.622 if ( ! class_exists( 'Akismet' ) ) {623 return;624 }625 626 // Bail if no Akismet key is set.627 if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) {628 return;629 }630 631 /**632 * Filters if BuddyPress Activity Akismet support has been disabled by another plugin.633 *634 * @since 1.6.0635 *636 * @param bool $value Return value of bp_is_akismet_active boolean function.637 */638 if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) {639 return;640 }641 642 // Instantiate Akismet for BuddyPress.643 $bp->activity->akismet = new BP_Akismet();644 }645 606 646 607 /** -
trunk/src/bp-activity/bp-activity-akismet.php
r10652 r11102 14 14 require dirname( __FILE__ ) . '/classes/class-bp-akismet.php'; 15 15 } 16 17 /** 18 * Loads Akismet filtering for activity. 19 * 20 * @since 1.6.0 21 * @since 2.3.0 We only support Akismet 3+. 22 */ 23 function bp_activity_setup_akismet() { 24 /** 25 * Filters if BuddyPress Activity Akismet support has been disabled by another plugin. 26 * 27 * @since 1.6.0 28 * 29 * @param bool $value Return value of bp_is_akismet_active boolean function. 30 */ 31 if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) { 32 return; 33 } 34 35 // Instantiate Akismet for BuddyPress. 36 buddypress()->activity->akismet = new BP_Akismet(); 37 } 38 add_action( 'bp_activity_setup_globals', 'bp_activity_setup_akismet' ); 16 39 17 40 /** -
trunk/src/bp-activity/classes/class-bp-activity-component.php
r11080 r11102 73 73 $akismet_key = bp_get_option( 'wordpress_api_key' ); 74 74 75 /** This filter is documented in bp-activity/bp-activity-a ctions.php */75 /** This filter is documented in bp-activity/bp-activity-akismet.php */ 76 76 if ( defined( 'AKISMET_VERSION' ) && class_exists( 'Akismet' ) && ( ! empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) { 77 77 $includes[] = 'akismet'; … … 371 371 372 372 /** 373 * Set up actions necessary for the component.374 *375 * @since 1.6.0376 */377 public function setup_actions() {378 379 // Spam prevention.380 add_action( 'bp_include', 'bp_activity_setup_akismet' );381 382 parent::setup_actions();383 }384 385 /**386 373 * Setup cache groups. 387 374 *
Note: See TracChangeset
for help on using the changeset viewer.