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

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

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.

Parameters

$screen

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

Default value: ''

Return

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

Source

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

1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
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',
        $this->screens['edit']['submit_text'],
        'bp-group-edit-' . $this->slug . '-submit'
    );
}

Changelog

Changelog
Version Description
BuddyPress 1.8.0 Introduced.

Questions?

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.