bp_core_admin_slugs_setup_handler

Handle saving of the BuddyPress slugs.

Description

bp_core_admin_slugs_setup_handler(); 

Usage

  1. if ( !function_exists( 'bp_core_admin_slugs_setup_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-slugs.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_admin_slugs_setup_handler(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-slugs.php  
  1. function bp_core_admin_slugs_setup_handler() { 
  2.  
  3. if ( isset( $_POST['bp-admin-pages-submit'] ) ) { 
  4. if ( !check_admin_referer( 'bp-admin-pages-setup' ) ) 
  5. return false; 
  6.  
  7. // Then, update the directory pages. 
  8. if ( isset( $_POST['bp_pages'] ) ) { 
  9.  
  10. $new_directory_pages = array(); 
  11. foreach ( (array) $_POST['bp_pages'] as $key => $value ) { 
  12. if ( isset( $valid_pages[ $key ] ) ) { 
  13. $new_directory_pages[ $key ] = (int) $value; 
  14. bp_core_update_directory_page_ids( $new_directory_pages ); 
  15.  
  16. $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings', 'updated' => 'true' ), 'admin.php' ) ); 
  17.  
  18. wp_redirect( $base_url );