Skip to:
Content

BuddyPress.org

Changeset 1347


Ignore:
Timestamp:
04/18/2009 07:45:32 AM (17 years ago)
Author:
apeatling
Message:

Added filters and pre/post save actions on group save() method.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1344 r1347  
    365365 *
    366366 * @package BuddyPress Core
    367  * @global $current_blog WordPress global variable containing information for the current blog being viewed.
    368  * @uses switch_to_blog() WordPress function to switch to a blog of the given ID.
    369  * @uses site_url() WordPress function to return the current site url.
     367 * @uses get_blog_option() WordPress function to fetch blog meta.
    370368 * @return $domain The domain URL for the blog.
    371369 */
  • trunk/bp-groups/bp-groups-classes.php

    r1291 r1347  
    9191        global $wpdb, $bp;
    9292       
    93         $this->name = wp_filter_kses( $this->name );
    94         $this->news = wp_filter_kses( $this->news );
    95         $this->description = wp_filter_kses( $this->description );
     93        $this->creator_id = apply_filters( 'groups_details_creator_id_pre_save', $this->creator_id, $this->id );
     94        $this->name = apply_filters( 'groups_details_name_pre_save', $this->name, $this->id );
     95        $this->slug = apply_filters( 'groups_details_slug_pre_save', $this->slug, $this->id );
     96        $this->description = apply_filters( 'groups_details_description_pre_save', $this->description, $this->id );
     97        $this->news = apply_filters( 'groups_details_news_pre_save', $this->news, $this->id );
     98        $this->description = apply_filters( 'groups_details_description_pre_save', $this->description, $this->id );
     99        $this->status = apply_filters( 'groups_details_status_pre_save', $this->status, $this->id );
     100        $this->is_invitation_only = apply_filters( 'groups_details_is_invitation_only_pre_save', $this->is_invitation_only, $this->id );
     101        $this->enable_wire = apply_filters( 'groups_details_enable_wire_pre_save', $this->enable_wire, $this->id );
     102        $this->enable_forum = apply_filters( 'groups_details_enable_forum_pre_save', $this->enable_forum, $this->id );
     103        $this->enable_photos = apply_filters( 'groups_details_enable_photos_pre_save', $this->enable_photos, $this->id );
     104        $this->photos_admin_only = apply_filters( 'groups_details_photos_admin_only_pre_save', $this->photos_admin_only, $this->id );
     105        $this->date_created = apply_filters( 'groups_details_date_created_pre_save', $this->date_created, $this->id );
     106        $this->avatar_thumb = apply_filters( 'groups_details_avatar_thumb_pre_save', $this->avatar_thumb, $this->id );
     107        $this->avatar_full = apply_filters( 'groups_details_avatar_full_pre_save', $this->avatar_full, $this->id );
     108
     109        do_action( 'groups_group_pre_save', $this );
    96110       
    97111        if ( $this->id ) {
     
    174188            $this->id = $wpdb->insert_id;
    175189        }
     190
     191        do_action( 'groups_group_post_save', $this );
    176192       
    177193        return true;
  • trunk/bp-groups/bp-groups-filters.php

    r1180 r1347  
    2727add_filter( 'bp_group_news', 'wp_filter_kses', 1 );
    2828add_filter( 'bp_group_name', 'wp_filter_kses', 1 );
     29add_filter( 'groups_details_name_pre_save', 'wp_filter_kses', 1 );
     30add_filter( 'groups_details_description_pre_save', 'wp_filter_kses', 1 );
     31add_filter( 'groups_details_news_pre_save', 'wp_filter_kses', 1 );
    2932
    3033add_filter( 'bp_group_description', 'stripslashes' );
Note: See TracChangeset for help on using the changeset viewer.