bp_save_group_type_role_labels_post_meta_box_data( $post_id )

Description

Source

File: bp-groups/bp-groups-admin.php

function bp_save_group_type_role_labels_post_meta_box_data( $post_id ){

	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
		return;

	$post = get_post( $post_id );

	if ( $post->post_type !== bp_get_group_type_post_type() )
		return;

	if ( ! isset( $_POST[ '_bp-group-type-nonce' ] ) )
		return;

	//verify nonce
	if ( ! wp_verify_nonce( $_POST[ '_bp-group-type-nonce' ], 'bp-group-type-edit-group-type' ) )
		return;

	//Save data
	$bp_group_roles_labels = filter_input( INPUT_POST, 'bp-group-type-role', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );

	$data = isset( $bp_group_roles_labels ) ? $bp_group_roles_labels : array();

	if ( empty( $data ) )
		return;


	update_post_meta( $post_id, '_bp_group_type_role_labels', $data );
}

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.