Skip to:
Content

BuddyPress.org

Changeset 3082


Ignore:
Timestamp:
06/27/2010 04:29:43 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2264

Location:
branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-forums.php

    r2893 r3082  
    125125
    126126    return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
     127}
     128
     129function bp_forums_update_forum( $args = '' ) {
     130    do_action( 'bbpress_init' );
     131
     132    $defaults = array(
     133        'forum_id'          => '',
     134        'forum_name'        => '',
     135        'forum_desc'        => '',
     136        'forum_slug'        => '',
     137        'forum_parent_id'   => BP_FORUMS_PARENT_FORUM_ID,
     138        'forum_order'       => false,
     139        'forum_is_category' => 0
     140    );
     141
     142    $r = wp_parse_args( $args, $defaults );
     143    extract( $r, EXTR_SKIP );
     144
     145    return bb_update_forum( array( 'forum_id' => (int)$forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) );
    127146}
    128147
  • branches/1.2/bp-groups.php

    r3069 r3082  
    19551955}
    19561956
     1957function groups_update_group_forum( $group_id ) {
     1958
     1959    $group = new BP_Groups_Group( $group_id );
     1960
     1961    if ( !$group->enable_forum )
     1962        return false;
     1963
     1964    $args = array(
     1965        'forum_id'      => groups_get_groupmeta( $group, 'forum_id' ),
     1966        'forum_name'    => $group->name,
     1967        'forum_desc'    => $group->desc,
     1968        'forum_slug'    => $group->slug
     1969    );
     1970
     1971    bp_forums_update_forum( apply_filters( 'groups_update_group_forum', $args ) );
     1972}
     1973add_action( 'groups_details_updated', 'groups_update_group_forum' );
     1974
    19571975function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
    19581976    global $bp;
Note: See TracChangeset for help on using the changeset viewer.