BP_Group_Extension::maybe_add_submit_button( string $screen = '' )

Add a submit button to the edit form, if it needs one.


There’s an inconsistency in the way that the group Edit and Create screens are rendered: the Create screen has a submit button built in, but the Edit screen does not. This function allows plugin authors to write markup that does not contain the submit button for use on both the Create and Edit screens – BP will provide the button if one is not found.



(string) (Optional) The screen markup, captured in the output buffer.

Default value: ''


(string) $screen The same markup, with a submit button added.


File: bp-groups/classes/class-bp-group-extension.php

	protected function maybe_add_submit_button( $screen = '' ) {
		if ( $this->has_submit_button( $screen ) ) {
			return $screen;

		return $screen . sprintf(
			'<div id="%s"><input type="submit" name="save" value="%s" id="%s"></div>',
			'bp-group-edit-' . $this->slug . '-submit-wrapper',
			'bp-group-edit-' . $this->slug . '-submit'


Version Description
BuddyPress 1.8.0 Introduced.


We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.