/** * Include component files. * * @since 1.5.0 * * @see BP_Component::includes() for a description of arguments. * * @param array $includes See BP_Component::includes() for a description. */ public function includes($includes = array()) { // Files to include. $includes = array('cssjs', 'actions', 'screens', 'filters', 'adminbar', 'template', 'functions', 'cache'); // Notifications support. if (bp_is_active('notifications')) { $includes[] = 'notifications'; } if (!buddypress()->do_autoload) { $includes[] = 'classes'; } // Load Akismet support if Akismet is configured. $akismet_key = bp_get_option('wordpress_api_key'); /** This filter is documented in bp-activity/bp-activity-akismet.php */ if (defined('AKISMET_VERSION') && class_exists('Akismet') && (!empty($akismet_key) || defined('WPCOM_API_KEY')) && apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { $includes[] = 'akismet'; } // Embeds - only applicable for WP 4.5+ if (version_compare($GLOBALS['wp_version'], '4.5', '>=') && bp_is_active($this->id, 'embeds')) { $includes[] = 'embeds'; } if (is_admin()) { $includes[] = 'admin'; } parent::includes($includes); }
/** * Allow Akismet setting field * * @since BuddyPress (1.6) * * @uses checked() To display the checked attribute */ function bp_admin_setting_callback_activity_akismet() { ?> <input id="_bp_enable_akismet" name="_bp_enable_akismet" type="checkbox" value="1" <?php checked( bp_is_akismet_active( true ) ); ?> /> <label for="_bp_enable_akismet"><?php _e( 'Allow Akismet to scan for activity stream spam', 'buddypress' ); ?></label> <?php }
/** * Include component files. * * @since BuddyPress (1.5) * * @see BP_Component::includes() for a description of arguments. * * @param array $includes See BP_Component::includes() for a description. */ public function includes($includes = array()) { // Files to include $includes = array('actions', 'screens', 'filters', 'classes', 'template', 'functions', 'notifications', 'cache'); // Load Akismet support if Akismet is configured $akismet_key = bp_get_option('wordpress_api_key'); if (defined('AKISMET_VERSION') && (!empty($akismet_key) || defined('WPCOM_API_KEY')) && apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { $includes[] = 'akismet'; } if (is_admin()) { $includes[] = 'admin'; } parent::includes($includes); }
/** * Loads Akismet filtering for activity. * * @since 1.6.0 * @since 2.3.0 We only support Akismet 3+. */ function bp_activity_setup_akismet() { /** * Filters if BuddyPress Activity Akismet support has been disabled by another plugin. * * @since 1.6.0 * * @param bool $value Return value of bp_is_akismet_active boolean function. */ if (!apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { return; } // Instantiate Akismet for BuddyPress. buddypress()->activity->akismet = new BP_Akismet(); }
/** * Include component files. * * @since 1.5.0 * * @see BP_Component::includes() for a description of arguments. * * @param array $includes See BP_Component::includes() for a description. */ public function includes($includes = array()) { // Files to include. $includes = array('cssjs', 'actions', 'screens', 'filters', 'template', 'functions', 'notifications', 'cache'); if (!buddypress()->do_autoload) { $includes[] = 'classes'; } // Load Akismet support if Akismet is configured. $akismet_key = bp_get_option('wordpress_api_key'); /** This filter is documented in bp-activity/bp-activity-actions.php */ if (defined('AKISMET_VERSION') && class_exists('Akismet') && (!empty($akismet_key) || defined('WPCOM_API_KEY')) && apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { $includes[] = 'akismet'; } if (is_admin()) { $includes[] = 'admin'; } parent::includes($includes); }
/** * Loads Akismet filtering for activity. * * @since 1.6.0 * @since 2.3.0 We only support Akismet 3+. */ function bp_activity_setup_akismet() { $bp = buddypress(); // Bail if Akismet is not active. if (!defined('AKISMET_VERSION')) { return; } // Bail if older version of Akismet. if (!class_exists('Akismet')) { return; } // Bail if no Akismet key is set. if (!bp_get_option('wordpress_api_key') && !defined('WPCOM_API_KEY')) { return; } /** * Filters if BuddyPress Activity Akismet support has been disabled by another plugin. * * @since 1.6.0 * * @param bool $value Return value of bp_is_akismet_active boolean function. */ if (!apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { return; } // Instantiate Akismet for BuddyPress. $bp->activity->akismet = new BP_Akismet(); }
/** * Loads Akismet filtering for activity. * * @since BuddyPress (1.6) * * @global object $bp BuddyPress global settings */ function bp_activity_setup_akismet() { global $bp; // Bail if Akismet is not active if (!defined('AKISMET_VERSION')) { return; } // Bail if no Akismet key is set if (!bp_get_option('wordpress_api_key') && !defined('WPCOM_API_KEY')) { return; } // Bail if BuddyPress Activity Akismet support has been disabled by another plugin if (!apply_filters('bp_activity_use_akismet', bp_is_akismet_active())) { return; } // Instantiate Akismet for BuddyPress $bp->activity->akismet = new BP_Akismet(); }