bp_get_group_admin_form_action

Generate the 'action' attribute for a group admin form.

Description

(string) bp_get_group_admin_form_action( (constant) $page = false, (bool) $group = false ); 

Returns (string)

Parameters (2)

0. $page — Optional. (constant) => false
Page slug.
1. $group — Optional. (bool) => false
Group object. Default: current group in the loop.

Usage

  1. if ( !function_exists( 'bp_get_group_admin_form_action' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // Optional. Page slug. 
  5. $page = false; 
  6.  
  7. // Optional. Group object. 
  8. // Default: current group in the loop. 
  9. $group = false; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = bp_get_group_admin_form_action($page, $group); 
  13.  

Defined (1)

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

/bp-groups/bp-groups-template.php  
  1. function bp_get_group_admin_form_action( $page = false, $group = false ) { 
  2. global $groups_template; 
  3.  
  4. if ( empty( $group ) ) { 
  5. $group =& $groups_template->group; 
  6.  
  7. if ( empty( $page ) ) { 
  8. $page = bp_action_variable( 0 ); 
  9.  
  10. /** 
  11. * Filters the 'action' attribute for a group admin form. 
  12. * @since 1.0.0 
  13. * @since 2.5.0 Added the `$group` parameter. 
  14. * @param string $value Action attribute for a group admin form. 
  15. * @param object $group Group object. 
  16. */ 
  17. return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page, $group );