Re: Replace WP profile edit with BP profile edit
Following DJPaul’s example, this works great as a starting piont:
function useraccount_redirect() {
if ( !is_site_admin() && strpos( strtolower( $_SERVER['REQUEST_URI'] ), '/wp-admin/profile.php' ) !== false ) {
bp_core_redirect( site_url() );
}
if ( !is_site_admin() && strpos( strtolower( $_SERVER['REQUEST_URI'] ), '/wp-login.php' ) !== false ) {
bp_core_redirect( site_url() );
}
}
add_action( 'plugins_loaded', 'useraccount_redirect', 11 );
Instead of site_url it should redirect to customized copies of wp-login.php and profile.php, so first I need to figure out the syntax for that – I’ll do some searches… – and then I need to decide how and where to create those custom pages.
Is there a way to include a custom page in a plugin folder. I can create a regular wp page in my template, but it would be nicer is it came with the plugin.
I found this example for creating an admin page in a plugin:
function bot_menu() {
global $wpdb;
include 'bot-admin.php';
}
function bot_admin_actions() {
add_options_page("Bot Counter", "Bot Counter", 1,
"Bot-Counter", "bot_menu");
}
add_action('admin_menu', 'bot_admin_actions');
I need a regular page. Would that be similar? Not really sure what’s going on here…
EDIT 2: OK, I’m not gonna bother with that at this point. I’ll first create a memberlogin.php and account.php as regular wp custom pages in my template.
More later…