bp_get_group_form_action

Generate the 'action' attribute for a group form.

Description

(string) bp_get_group_form_action( (string) $page, (bool) $group = false ); 

Returns (string)

Parameters (2)

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

Usage

  1. if ( !function_exists( 'bp_get_group_form_action' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-groups/bp-groups-template.php'; 
  3.  
  4. // Page slug. 
  5. $page = ''; 
  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_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_form_action( $page, $group = false ) { 
  2. global $groups_template; 
  3.  
  4. if ( empty( $group ) ) { 
  5. $group =& $groups_template->group; 
  6.  
  7. /** 
  8. * Filters the 'action' attribute for a group form. 
  9. * @since 1.0.0 
  10. * @since 2.5.0 Added the `$group` parameter. 
  11. * @param string $value Action attribute for a group form. 
  12. * @param object $group Group object. 
  13. */ 
  14. return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page, $group );