BuddyDev

Search

[Resolved] Need to delete a textline in BuddyBlog plugin

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #15131

    Hello Daniel,

    Try the following code in your “bp-cutom.php” file.

    
    /**
     * Modify New Post tab link
     *
     * @param array $subnav Subnav item array.
     *
     * @return mixed
     */
    function buddydev_modify_new_post_tab_link( $subnav ) {
    	$subnav['new-post']['link'] = 'https://google.com'; // Replace URL with yours
    	return $subnav;
    }
    add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );
    

    Thank You
    Ravi

  • Participant
    Level: Master
    Posts: 497
    Daniel on #15165

    Hi Ravi,

    I have applied the code but it is not working.

    Do I need to enter the link to the post page without the tick ? Means https://google.com instaead of ‘https://google.com’ ?

    Thank you.

    Regards,
    Daniel

  • Participant
    Level: Master
    Posts: 497
    Daniel on #15168

    Hi Ravi,

    Also, when clicking on the New Post tab, I get still redirected to this URL: https://mywebsite.com/members-2/mywebsite/buddyblog/edit/

    Thank you for your assistance.

    Regards,
    Daniel

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #15180

    Hello Daniel,

    Are you using your link inside '' this string. For example.

    
    
    $subnav['new-post']['link'] = 'https://google.com'; 
    
    

    Please check and let me know.

    Thank you
    Ravi

    • This reply was modified 6 years, 6 months ago by Ravi.
    • This reply was modified 6 years, 6 months ago by Ravi.
  • Participant
    Level: Master
    Posts: 497
    Daniel on #20383

    Hi Ravi,

    I have tried to put the code into bp-custom.php but when clicking on the “New Post” Tab, then it still does not redirect but I receive a 404Error saying page not found.

    /**
     * Modify New Post tab link
     *
     * @param array $subnav Subnav item array.
     *
     * @return mixed
     */
    function buddydev_modify_new_post_tab_link( $subnav ) {
    	$subnav['new-post']['link'] = 'https://mywebsitelink.com'; // Replace URL with yours
    	return $subnav;
    }
    add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );

    And yes, I have used the link inside the ” string but it’s not working when applying the code.

    Thank you for your time.

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20392

    Hi Daniel,
    Which version of BuddyBlog you are using?

    As far as I see, Ravi’s code does work. Please note that it only changes the url in the sub menu nothing else.

    Where you point that menu is up to you.

    The link specified should be your own. To be hones, a better strategy would have been to redirect instead of changing this. Because that way, even editing would work.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 497
    Daniel on #20394

    Hi Brajesh,

    Thank you for your help on this issue.

    I have pasted exactly the whole code Ravi has provided into bp-custom.php but when I click on “Create New Post” then it says, Error 404 page not found.

    What I try to do is that the user will be redirected to a specific page in order that he can create a new post, but he doesn’t get redirected with this provided code from Ravi.

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20395

    Hi Daniel,
    Have you replaced this line

    
    $subnav['new-post']['link'] = 'https://mywebsitelink.com'; 
    

    with the actual url of your site?

  • Participant
    Level: Master
    Posts: 497
    Daniel on #20397

    Hi Brajesh,

    Yes I did, I have put the proper link into the code from Ravi.

    This is the whole code I have put in. But it has no effect in front end.

    /**
     * Modify New Post tab link
     *
     * @param array $subnav Subnav item array.
     *
     * @return mixed
     */
    function buddydev_modify_new_post_tab_link( $subnav ) {
    	$subnav['new-post']['link'] = 'https://properlinktocreatenewpost'; // Replace URL with yours
    	return $subnav;
    }
    add_filter( 'buddyblog_setup_sub_nav', 'buddydev_modify_new_post_tab_link' );

    Thank you for your help.

    Regards
    Daniel

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #20400

    Hi Daniel,
    Can you please check the version of BuddyBlog that you are using and let me know?

    Thank you
    Brajesh

The topic ‘ [Resolved] Need to delete a textline in BuddyBlog plugin’ is closed to new replies.

This topic is: resolved