BP_Group_Extension::call_edit_screen_save()

Check the nonce, and call the edit_screen_save() method.

Description

Source

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

1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
public function call_edit_screen_save() {
    if ( empty( $_POST ) ) {
        return;
    }
 
    // When DOING_AJAX, the POST global will be populated, but we
    // should assume it's a save.
    if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
        return;
    }
 
    $this->check_nonce( 'edit' );
 
    // Detect whether the screen_save_callback is performing a
    // redirect, so that we don't do one of our own.
    add_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
 
    // Call the extension's save routine.
    call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id );
 
    // Clean up detection filters.
    remove_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) );
 
    // Perform a redirect only if one has not already taken place.
    if ( empty( $this->post_save_redirect ) ) {
 
        /**
         * Filters the URL to redirect to after group edit screen save.
         *
         * Only runs if a redirect has not already occurred.
         *
         * @since BuddyPress 2.1.0
         *
         * @param string $value URL to redirect to.
         */
        $redirect_to = apply_filters( 'bp_group_extension_edit_screen_save_redirect', bp_get_requested_url( ) );
 
        bp_core_redirect( $redirect_to );
        die();
    }
}

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.