bp_get_group_member_promote_mod_link

Generate a URL for promoting a user to moderator.

Description

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

Returns (string)

Parameters (1)

0. $args — Optional. (string) => ''
The args.

Options

  • user_id (int) => 0

    ID of the member to promote. Default: current member in a group member loop.

array(

    /**
     * ID of the member to promote. Default: current member in a group member loop.
     *
     * @type int
     */
    'user_id' => 0
);        


Usage

  1. if ( !function_exists( 'bp_get_group_member_promote_mod_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // The args. 
  5. $args = array( 
  6. 'user_id' => 0 
  7. ); 
  8.  
  9. // NOTICE! Understand what this does before running. 
  10. $result = bp_get_group_member_promote_mod_link($args); 
  11.  

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_member_promote_mod_link( $args = '' ) { 
  2. global $members_template, $groups_template; 
  3.  
  4. $defaults = array( 
  5. 'user_id' => $members_template->member->user_id,  
  6. 'group' => &$groups_template->group 
  7. ); 
  8.  
  9. $r = wp_parse_args( $args, $defaults ); 
  10. extract( $r, EXTR_SKIP ); 
  11.  
  12. /** 
  13. * Filters a URL for promoting a user to moderator. 
  14. * @since 1.1.0 
  15. * @param string $value URL to use for promoting a user to moderator. 
  16. */ 
  17. return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );