Skip to:
Content

BuddyPress.org

Changeset 9086


Ignore:
Timestamp:
10/18/2014 11:33:26 AM (10 years ago)
Author:
boonebgorges
Message:

Hook documentation for bp-activity-akismet.php and bp-activity-cssjs.php.

Props tw2113.
See #5938.

Location:
trunk/src/bp-activity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-akismet.php

    r7395 r9086  
    113113            echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&amp;action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>';
    114114
     115        /**
     116         * Filters the list of actions for the current activity's row.
     117         *
     118         * @since BuddyPress (1.6.0)
     119         *
     120         * @param array $actions Array of available actions for the current activity item's row.
     121         */
    115122        return apply_filters( 'bp_akismet_comment_row_action', $actions );
    116123    }
     
    240247     */
    241248    public static function get_activity_types() {
     249
     250        /**
     251         * Filters the list of activity types that Akismet should automatically check for spam.
     252         *
     253         * @since BuddyPress (1.6.0)
     254         *
     255         * @param array Array of default activity types for Akismet to check.
     256         */
    242257        return apply_filters( 'bp_akismet_get_activity_types', array( 'activity_comment', 'activity_update' ) );
    243258    }
     
    255270        $this->last_activity = $activity;
    256271
     272        /**
     273         * Fires after marking an activity item has been marked as spam.
     274         *
     275         * @since BuddyPress (1.6.0)
     276         *
     277         * @param BP_Activity_Activity $activity Activity object being marked as spam.
     278         * @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".
     279         */
    257280        do_action( 'bp_activity_akismet_mark_as_spam', $activity, $source );
    258281    }
     
    271294            $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id );
    272295
     296        /**
     297         * Fires after marking an activity item has been marked as ham.
     298         *
     299         * @since BuddyPress (1.6.0)
     300         *
     301         * @param BP_Activity_Activity $activity Activity object being marked as ham.
     302         * @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).
     303         */
    273304        do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source );
    274305    }
     
    312343            $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';
    313344
     345        /**
     346         * Filters activity data before being sent to Akismet to inspect.
     347         *
     348         * @since BuddyPress (1.6.0)
     349         *
     350         * @param array $activity_data Array of activity data for Akismet to inspect.
     351         * @param BP_Activity_Activity $activity Activity item data.
     352         */
    314353        return apply_filters( 'bp_akismet_build_akismet_data_package', $activity_data, $activity );
    315354    }
     
    348387        // Spam
    349388        if ( 'true' == $activity_data['bp_as_result'] ) {
    350             // Action for plugin authors
     389            /**
     390             * Fires after an activity item has been proven to be spam, but before officially being marked as spam.
     391             *
     392             * @since BuddyPress (1.6.0)
     393             *
     394             * @param BP_Activity_Activity $activity The activity item proven to be spam.
     395             * @param array $activity_data Array of activity data for item including Akismet check results data.
     396             */
    351397            do_action_ref_array( 'bp_activity_akismet_spam_caught', array( &$activity, $activity_data ) );
    352398
     
    615661    global $bp, $wpdb;
    616662
     663    /**
     664     * Filters the threshold for how many days old Akismet metadata needs to be before being automatically deleted.
     665     *
     666     * @since BuddyPress (1.6.0)
     667     *
     668     * @param integer 15 How many days old metadata needs to be.
     669     */
    617670    $interval = apply_filters( 'bp_activity_akismet_delete_meta_interval', 15 );
    618671
  • trunk/src/bp-activity/bp-activity-cssjs.php

    r8958 r9086  
    4242    }
    4343
    44     // Print a list of the current user's friends to the page for quicker @mentions lookups.
     44    /**
     45     * Fires at the end of the Activity Mentions script.
     46     *
     47     * This is the hook where BP components can add their own prefetched results
     48     * friends to the page for quicker @mentions lookups.
     49     *
     50     * @since BuddyPress (2.1.0)
     51     */
    4552    do_action( 'bp_activity_mentions_prime_results' );
    4653}
Note: See TracChangeset for help on using the changeset viewer.