• Hi!

    Is it possible to change default members profile landing tab to social articles? I know how to change it to profile tab

    /**
     * Change BuddyPress default Members landing tab.
     */
    define('BP_DEFAULT_COMPONENT', 'profile' );

    But I can’t do the same with social articles tab.

    https://ww.wp.xz.cn/plugins/social-articles/

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is how I got my button to work (I point to url /articles/postarticle but you can change that to whatever you want

    function redirect2profile(){
    	include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    	if($_SERVER['REQUEST_URI'] == '/articles/postarticle/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/'. $current_user->user_login . '/articles/new');
    		exit();
    	} else {
    		if ($_SERVER['REQUEST_URI'] == '/profile/' && is_plugin_active('buddypress/bp-loader.php') && !is_user_logged_in()) {
    		wp_redirect( get_bloginfo('url') . '/register/');
    		exit();
    		}}
    
     }
    add_action('init', 'redirect2profile');

    slight tweak

    function redirect2profile(){
    	include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    	if($_SERVER['REQUEST_URI'] == '/articles/postarticle/' && is_plugin_active('buddypress/bp-loader.php') && is_user_logged_in()){
    		global $current_user;
    		wp_redirect( get_bloginfo('url') . '/'. $current_user->user_login . '/articles/new');
    		exit();
    	} else {
    		if ($_SERVER['REQUEST_URI'] == '/articles/postarticle/' && is_plugin_active('buddypress/bp-loader.php') && !is_user_logged_in()) {
    		wp_redirect( get_bloginfo('url') . '/wplogin?action=register');
    		exit();
    		}}
    
     }
    add_action('init', 'redirect2profile');

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Default profile tab’ is closed to new replies.