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

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

Description Description

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.

Top ↑

Parameters Parameters


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

Default value: ''

Top ↑

Return Return

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

Source Source

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'

Top ↑

Changelog Changelog

Version Description
1.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.