bp_forums_update_forum

Update a forum.

Description

bp_forums_update_forum( (string) $args = '' ); 

Wrapper for .

Parameters (1)

0. $args — Optional. (string) => ''
Forum setup arguments.

Options

  • forum_id (int) => 0

    ID of the forum to be updated.

  • forum_name (string) => ''

    Name of the forum.

  • forum_desc (string) => ''

    Description of the forum.

array(

    /**
     * ID of the forum to be updated.
     *
     * @type int
     */
    'forum_id' => 0,

    /**
     * Name of the forum.
     *
     * @type string
     * @default ''
     */
    'forum_name' => '',

    /**
     * Description of the forum.
     *
     * @type string
     * @default ''
     */
    'forum_desc' => ''
);        


Usage

  1. if ( !function_exists( 'bp_forums_update_forum' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bp-forums-functions.php'; 
  3.  
  4. // Forum setup arguments. 
  5. $args = array( 
  6. 'forum_id' => 0, 
  7. 'forum_name' => '', 
  8. 'forum_desc' => '' 
  9. ); 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = bp_forums_update_forum($args); 
  13.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bp-forums-functions.php  
  1. function bp_forums_update_forum( $args = '' ) { 
  2.  
  3. /** This action is documented in bp-forums/bp-forums-screens.php */ 
  4.  
  5. $r = wp_parse_args( $args, array( 
  6. 'forum_id' => '',  
  7. 'forum_name' => '',  
  8. 'forum_desc' => '',  
  9. 'forum_slug' => '',  
  10. 'forum_parent_id' => bp_forums_parent_forum_id(),  
  11. 'forum_order' => false,  
  12. 'forum_is_category' => 0 
  13. ) ); 
  14. extract( $r, EXTR_SKIP ); 
  15.  
  16. 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 ) );