<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][9086] trunk/src/bp-activity: Hook documentation for bp-activity-akismet.php and bp-activity-cssjs.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/9086">9086</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/9086","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>boonebgorges</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-10-18 11:33:26 +0000 (Sat, 18 Oct 2014)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Hook documentation for bp-activity-akismet.php and bp-activity-cssjs.php.
Props tw2113.
See <a href="http://buddypress.trac.wordpress.org/ticket/5938">#5938</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivitybpactivityakismetphp">trunk/src/bp-activity/bp-activity-akismet.php</a></li>
<li><a href="#trunksrcbpactivitybpactivitycssjsphp">trunk/src/bp-activity/bp-activity-cssjs.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivityakismetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-akismet.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-akismet.php 2014-10-17 17:13:09 UTC (rev 9085)
+++ trunk/src/bp-activity/bp-activity-akismet.php 2014-10-18 11:33:26 UTC (rev 9086)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -112,6 +112,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $desc )
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the list of actions for the current activity's row.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param array $actions Array of available actions for the current activity item's row.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'bp_akismet_comment_row_action', $actions );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -239,6 +246,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array List of activity types.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public static function get_activity_types() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Filters the list of activity types that Akismet should automatically check for spam.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param array Array of default activity types for Akismet to check.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'bp_akismet_get_activity_types', array( 'activity_comment', 'activity_update' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,6 +269,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update()
</span><span class="cx" style="display: block; padding: 0 10px"> $this->last_activity = $activity;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after marking an activity item has been marked as spam.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param BP_Activity_Activity $activity Activity object being marked as spam.
+ * @param string $source Source of the whom marked as spam. Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet".
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'bp_activity_akismet_mark_as_spam', $activity, $source );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -270,6 +293,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'true' == bp_activity_get_meta( $activity->id, '_bp_akismet_result' ) && !bp_activity_get_meta( $activity->id, '_bp_akismet_user_result' ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after marking an activity item has been marked as ham.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param BP_Activity_Activity $activity Activity object being marked as ham.
+ * @param string $source Source of the whom marked as ham. Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed).
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -311,6 +342,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> elseif ( !empty( $activity->secondary_item_id ) && !empty( $_POST['_bp_as_nonce_' . $activity->secondary_item_id] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST["_bp_as_nonce_{$activity->secondary_item_id}"], "_bp_as_nonce_{$userdata->ID}_{$activity->secondary_item_id}" ) ? 'passed' : 'failed';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters activity data before being sent to Akismet to inspect.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param array $activity_data Array of activity data for Akismet to inspect.
+ * @param BP_Activity_Activity $activity Activity item data.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'bp_akismet_build_akismet_data_package', $activity_data, $activity );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -347,7 +386,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Spam
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'true' == $activity_data['bp_as_result'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Action for plugin authors
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after an activity item has been proven to be spam, but before officially being marked as spam.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param BP_Activity_Activity $activity The activity item proven to be spam.
+ * @param array $activity_data Array of activity data for item including Akismet check results data.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action_ref_array( 'bp_activity_akismet_spam_caught', array( &$activity, $activity_data ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Mark as spam
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -614,6 +660,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_activity_akismet_delete_old_metadata() {
</span><span class="cx" style="display: block; padding: 0 10px"> global $bp, $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the threshold for how many days old Akismet metadata needs to be before being automatically deleted.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param integer 15 How many days old metadata needs to be.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> $interval = apply_filters( 'bp_activity_akismet_delete_meta_interval', 15 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Enforce a minimum of 1 day
</span></span></pre></div>
<a id="trunksrcbpactivitybpactivitycssjsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-cssjs.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-cssjs.php 2014-10-17 17:13:09 UTC (rev 9085)
+++ trunk/src/bp-activity/bp-activity-cssjs.php 2014-10-18 11:33:26 UTC (rev 9086)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,8 +41,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_style_add_data( 'bp-mentions-css', 'suffix', $min );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Print a list of the current user's friends to the page for quicker @mentions lookups.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires at the end of the Activity Mentions script.
+ *
+ * This is the hook where BP components can add their own prefetched results
+ * friends to the page for quicker @mentions lookups.
+ *
+ * @since BuddyPress (2.1.0)
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'bp_activity_mentions_prime_results' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
</ins></span></pre>
</div>
</div>
</body>
</html>