The MU forums have moved to WordPress.org

[BP] How to edit elements in admin bar? (7 posts)

  1. karolha
    Member
    Posted 14 years ago #

    Hello!
    I would like to edit a bit my admin bar in BP, for example text inside each element: ( Visit -> Take a look / or / Just me -> Lorem ipsum ( inside ny account ) and something like that )
    In bp-core-adminbar i have found function for account menu ( I'd like to edit it too )
    Inside this function is a code for elements:


    'echo '</p>

      ';</p>
      <p> /* Loop through each navigation item */
      $counter = 0;
      foreach( $bp->bp_nav as $nav_item ) {
      $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';</p>
      <p> echo '<li' . $alt . '>';
      echo '' . $nav_item['name'] . '';</p>
      <p> if ( is_array( $bp->bp_options_nav[$nav_item['css_id']] ) ) {
      echo '
      ';
      $sub_counter = 0;</p>
      <p> foreach( $bp->bp_options_nav[$nav_item['css_id']] as $subnav_item ) {
      $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
      echo '<li' . $alt . '>' . $subnav_item['name'] . '';
      $sub_counter++;
      }
      echo '

    <p>';'

    If i want to edit tekxt between

    . $subnav_item['name'] .

    I have to find . $subnav_item['name'] . ... but where is it?

    Cheers!
    K

  2. SteveAtty
    Member
    Posted 14 years ago #

    Have you asked over in the BP forums?

  3. karolha
    Member
    Posted 14 years ago #

  4. SteveAtty
    Member
    Posted 14 years ago #

    Well it is the middle of the Christmas holidays....

  5. karolha
    Member
    Posted 14 years ago #

    :) And its quite hard to solve... :)

    Merry Xmas
    K

  6. karolha
    Member
    Posted 14 years ago #

    bump!

  7. djanubis
    Member
    Posted 14 years ago #

    You'll find it in bp-core-adminbar.php and function function bp_adminbar_random_menu.
    All text is in international format. A quick and dirty way is editing directly standard strings. But this is not really clean.
    The best way is using gettext tools and regenerating a en-GB.mo file. Or, if you want something simpler, look at the Codestyling-localization plugin which allows pretty good and surviving to updates changes.

About this Topic

  • Started 14 years ago by karolha
  • Latest reply from djanubis