mibrenner (@mibrenner)

Forum Replies Created

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

  • mibrenner
    Participant

    @mibrenner

    Thank you for your help. That helped me filter through the different parts of the breadcrumb and selectively replace the default forum URL with my static forum URL.

    For anyone else reading this that wants the code I used, to replace the URL (or text if you want to) of the “Forum” portion of the breadcrumb:

    function gnpwdr_bbp_breadcrumb_url($crumbs) {
      global $bsp_breadcrumb;
      $pattern = '/(?<=href\=")[^]]+?(?=")/';
      $my_forum_url = '/custom-page/';
      $crumbs[0] = preg_replace($pattern, $my_forum_url, $crumbs[0]);
      return $crumbs; 
    }
    add_filter('bbp_breadcrumbs', 'gnpwdr_bbp_breadcrumb_url');

    mibrenner
    Participant

    @mibrenner

    Thanks for your reply, Robin. I activated your plugin and looked through your functions file but, unfortunately, neither route addresses my issue, which is editing the specific forum’s URL.

    Even in one of your plugin’s screenshots, you don’t show the specific forum as editable within the breadcrumbs. “Main Forum”, between Root and Current.

    breadcrumb settings

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