bp_nouveau_group_manage_screen()

Load the requested Manage Screen for the current group.

Description

Source

File: bp-templates/bp-nouveau/includes/groups/template-tags.php

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
function bp_nouveau_group_manage_screen() {
    $action          = bp_action_variable( 0 );
    $is_group_create = bp_is_group_create();
    $output          = '';
 
    if ( $is_group_create ) {
        $action = bp_action_variable( 1 );
    }
 
    $screen_id = sanitize_file_name( $action );
    if ( ! bp_is_group_admin_screen( $screen_id ) && ! bp_is_group_creation_step( $screen_id ) ) {
        return;
    }
 
    if ( ! $is_group_create ) {
        /**
         * Fires inside the group admin form and before the content.
         *
         * @since BuddyPress 1.1.0
         */
        do_action( 'bp_before_group_admin_content' );
 
        $core_screen = bp_nouveau_group_get_core_manage_screens( $screen_id );
 
    // It's a group step, get the creation screens.
    } else {
        $core_screen = bp_nouveau_group_get_core_create_screens( $screen_id );
    }
 
    if ( ! $core_screen ) {
        if ( ! $is_group_create ) {
            /**
             * Fires inside the group admin template.
             *
             * Allows plugins to add custom group edit screens.
             *
             * @since BuddyPress 1.1.0
             */
            do_action( 'groups_custom_edit_steps' );
 
        // Else use the group create hook
        } else {
            /**
             * Fires inside the group admin template.
             *
             * Allows plugins to add custom group creation steps.
             *
             * @since BuddyPress 1.1.0
             */
            do_action( 'groups_custom_create_steps' );
        }
 
    // Else we load the core screen.
    } else {
        if ( ! empty( $core_screen['hook'] ) ) {
            /**
             * Fires before the display of group delete admin.
             *
             * @since BuddyPress 1.1.0 For most hooks.
             * @since BuddyPress 2.4.0 For the cover photo hook.
             */
            do_action( 'bp_before_' . $core_screen['hook'] );
        }
 
        $template = 'groups/single/admin/' . $screen_id;
 
        if ( ! empty( $core_screen['template'] ) ) {
            $template = $core_screen['template'];
        }
 
        bp_get_template_part( $template );
 
        if ( ! empty( $core_screen['hook'] ) ) {
            /**
             * Fires before the display of group delete admin.
             *
             * @since BuddyPress 1.1.0 For most hooks.
             * @since BuddyPress 2.4.0 For the cover photo hook.
             */
            do_action( 'bp_after_' . $core_screen['hook'] );
        }
 
        if ( ! empty( $core_screen['nonce'] ) ) {
            if ( ! $is_group_create ) {
                $output = sprintf( '<p><input type="submit" value="%s" id="save" name="save" /></p>', esc_attr__( 'Save Changes', 'buddyboss' ) );
 
                // Specific case for the delete group screen
                if ( 'delete-group' === $screen_id ) {
                    $output = sprintf(
                        '<div class="submit">
                            <input type="submit" disabled="disabled" value="%s" id="delete-group-button" name="delete-group-button" />
                        </div>',
                        esc_attr__( 'Delete Group', 'buddyboss' )
                    );
                }
            }
        }
    }
 
    if ( $is_group_create ) {
        /**
         * Fires before the display of the group creation step buttons.
         *
         * @since BuddyPress 1.1.0
         */
        do_action( 'bp_before_group_creation_step_buttons' );
 
        if ( 'crop-image' !== bp_get_avatar_admin_step() ) {
            $creation_step_buttons = '';
 
            if ( ! bp_is_first_group_creation_step() ) {
                $creation_step_buttons .= sprintf(
                    '<input type="button" value="%1$s" id="group-creation-previous" name="previous" onclick="%2$s" />',
                    esc_attr__( 'Previous Step', 'buddyboss' ),
                    "location.href='" . esc_js( esc_url_raw( bp_get_group_creation_previous_link() ) ) . "'"
                );
            }
 
            if ( ! bp_is_last_group_creation_step() && ! bp_is_first_group_creation_step() ) {
                $creation_step_buttons .= sprintf(
                    '<input type="submit" value="%s" id="group-creation-next" name="save" />',
                    esc_attr__( 'Next Step', 'buddyboss' )
                );
            }
 
            if ( bp_is_first_group_creation_step() ) {
                $creation_step_buttons .= sprintf(
                    '<input type="submit" value="%s" id="group-creation-create" name="save" />',
                    esc_attr__( 'Create Group and Continue', 'buddyboss' )
                );
            }
 
            if ( bp_is_last_group_creation_step() ) {
                $creation_step_buttons .= sprintf(
                    '<input type="submit" value="%s" id="group-creation-finish" name="save" />',
                    esc_attr__( 'Finish', 'buddyboss' )
                );
            }
 
            // Set the output for the buttons
            $output = sprintf( '<div class="submit" id="previous-next">%s</div>', $creation_step_buttons );
        }
 
        /**
         * Fires after the display of the group creation step buttons.
         *
         * @since BuddyPress 1.1.0
         */
        do_action( 'bp_after_group_creation_step_buttons' );
    }
 
    /**
     * Avoid nested forms with the Backbone views for the group invites step.
     */
    if ( 'group-invites' === bp_get_groups_current_create_step() ) {
        printf(
            '<form action="%s" method="post" enctype="multipart/form-data">',
            bp_get_group_creation_form_action()
        );
    }
 
    if ( ! empty( $core_screen['nonce'] ) ) {
        wp_nonce_field( $core_screen['nonce'] );
    }
 
    printf(
        '<input type="hidden" name="group-id" id="group-id" value="%s" />',
        $is_group_create ? esc_attr( bp_get_new_group_id() ) : esc_attr( bp_get_group_id() )
    );
 
    // The submit actions
    echo $output;
 
    if ( ! $is_group_create ) {
        /**
         * Fires inside the group admin form and after the content.
         *
         * @since BuddyPress 1.1.0
         */
        do_action( 'bp_after_group_admin_content' );
 
    } else {
        /**
         * Fires and displays the groups directory content.
         *
         * @since BuddyPress 1.1.0
         */
        do_action( 'bp_directory_groups_content' );
    }
 
    /**
     * Avoid nested forms with the Backbone views for the group invites step.
     */
    if ( 'group-invites' === bp_get_groups_current_create_step() ) {
        echo '</form>';
    }
}

Changelog

Changelog
Version Description
BuddyPress 3.0.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.