Skip to content

Instantly share code, notes, and snippets.

@imath
Created February 9, 2015 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imath/07e79c2244c5ab2e0a1b to your computer and use it in GitHub Desktop.
Save imath/07e79c2244c5ab2e0a1b to your computer and use it in GitHub Desktop.
Patch to test if BuddyPress Core ticket #6197 contains the right fix (Should only be used with version 2.2.0 when signups are not allowed)
<?php
/**
* BP Custom file
* see https://codex.buddypress.org/themes/bp-custom-php/ for explanations about how to use it
*/
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
function test_retain_register_activate_signup_not_allowed( $page_ids = array() ) {
if ( ! version_compare( buddypress()->version, '2.2', '=' ) ) {
return $page_ids;
}
$all_page_ids = bp_get_option( 'bp-pages' );
if ( ! isset( $page_ids['register'] ) && ! empty( $all_page_ids['register'] ) ) {
$page_ids['register'] = $all_page_ids['register'];
}
if ( ! isset( $page_ids['activate'] ) && ! empty( $all_page_ids['activate'] ) ) {
$page_ids['activate'] = $all_page_ids['activate'];
}
return $page_ids;
}
add_filter( 'bp_core_get_directory_page_ids', 'test_retain_register_activate_signup_not_allowed', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment