/bp-custom.php Secret
Created
February 9, 2015 22:13
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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