Making WordPress.org


Ignore:
Timestamp:
05/10/2022 11:25:22 PM (4 years ago)
Author:
iandunn
Message:

Profiles: Apply coding standards.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-activity-handler/wporg-profiles-activity-handler.php

    r11816 r11828  
    4242
    4343            // Disable default BP activity features
    44             add_filter( 'bp_activity_can_comment',    '__return_false' );
    45             add_filter( 'bp_activity_do_mentions',    '__return_false' );
    46             add_filter( 'bp_activity_use_akismet',    '__return_false' );
     44            add_filter( 'bp_activity_can_comment', '__return_false' );
     45            add_filter( 'bp_activity_do_mentions', '__return_false' );
     46            add_filter( 'bp_activity_use_akismet', '__return_false' );
    4747        }
    4848
     
    5050         * Gets a user by either login, slug, or id.
    5151         *
    52          * @param string|int     $username The user's login, slug, or id.
     52         * @param string|int $username The user's login, slug, or id.
     53         *
    5354         * @return WP_User|false WP_User object on success, false on failure.
    5455         */
     
    7879         * than the ones for BuddyPress.org.
    7980         *
    80          * @param  array $tables The default tables.
     81         * @param array $tables The default tables.
     82         *
    8183         * @return array
    8284         */
     
    9496         * than the ones for BuddyPress.org.
    9597         *
    96          * @param  array $tables The default meta table.
     98         * @param array $tables The default meta table.
     99         *
    97100         * @return array
    98101         */
     
    108111         * Ensures that the activity component is activated.
    109112         *
    110          * @param  array $activated Array of activated components.
     113         * @param array $activated Array of activated components.
     114         *
    111115         * @return array
    112116         */
     
    301305                $required_args[] = 'message';
    302306                $required_args[] = 'url';
    303                 $required_args = array_merge( $required_args, array( 'title', 'site', 'message', 'url' ) );
     307                $required_args   = array_merge( $required_args, array( 'title', 'site', 'message', 'url' ) );
    304308            }
    305309            if ( in_array( $type, array( 'forum_topic_create', 'forum_topic_remove' ) ) ) {
     
    327331                'secondary_item_id' => intval( $_POST['forum_id'] ),
    328332            );
    329             $activity_id = bp_activity_get_activity_id( $args );
     333            $activity_id  = bp_activity_get_activity_id( $args );
    330334            $activity_obj = $activity_id ? new BP_Activity_Activity( $activity_id ) : false;
    331335
     
    347351                        esc_html( $_POST['site'] )
    348352                    );
    349                 }
    350                 // Action message for reply creation.
    351                 else {
     353
     354                } else {
     355                     // Action message for reply creation.
    352356                    $action = sprintf(
    353357                        'Posted a <a href="%s">reply</a> to <i>%s</i>, on the site %s',
     
    371375
    372376                return bp_activity_add( $args );
    373             }
    374             // Remove activity related to a topic or reply.
    375             elseif ( in_array( $type, array( 'forum_topic_remove', 'forum_reply_remove' ) ) ) {
     377
     378            } elseif ( in_array( $type, array( 'forum_topic_remove', 'forum_reply_remove' ) ) ) {
     379                // Remove activity related to a topic or reply.
    376380                if ( ! $activity_obj ) {
    377381                    return '-1 Activity not previously reported.';
     
    493497         */
    494498        private function handle_trac_activity() {
    495             $args = array();
    496 
    497499            $user = $this->get_user( $_POST['user'] );
    498500
     
    555557                foreach ( $usernames as $username ) {
    556558                    $user = $this->get_user( $username );
    557                     if ( empty( $user ) ) continue;
     559                    if ( empty( $user ) ) {
     560                        continue;
     561                    }
    558562                    $args = array(
    559563                        'user_id'           => $user->ID,
     
    638642                    }
    639643                } elseif ( 'attendee_checked_in' == $_POST['activity_type'] ) {
    640                     $type = 'wordcamp_attendee_checked_in';
     644                    $type  = 'wordcamp_attendee_checked_in';
    641645                    $order = absint( $_POST['checked_in_count'] );
    642646
     
    663667                'item_id'           => intval( $item_id ),
    664668                'secondary_item_id' => intval( $_POST['wordcamp_id'] ),
    665                 'hide_sitewide'     => false
     669                'hide_sitewide'     => false,
    666670            );
    667671
     
    736740                'item_id'           => intval( $item_id ),
    737741                'secondary_item_id' => false,
    738                 'hide_sitewide'     => false
     742                'hide_sitewide'     => false,
    739743            );
    740744
Note: See TracChangeset for help on using the changeset viewer.