Skip to:
Content
Pages
Categories
Search
Top
Bottom

Safe to edit BuddyPress Plugin?


  • Jam
    Member

    @pimaniii

    Like a theme, do I need to make a child-plugin to edit the BP plugin? How can I ensure that all future updates are safe?

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

  • Andrea Rennick
    Participant

    @andrea_r

    Don’t edit the plugin. The changes WILL be overwritten. There’s tons of hooks everywhere and a different process for doing things, depending on what you wanted to change.

    What are you tying to do?


    Jam
    Member

    @pimaniii

    I am changing many things. For the theme, I created a child. But I will be editing slugs, some functions, etc to change my site’s layout and look.


    r-a-y
    Keymaster

    @r-a-y

    Hook into the filters or actions whenever possible. (Basically anywhere in the codebase with an ‘apply_filters’ or ‘do_action’ call.) Otherwise, you’ll run into major upgrade problems and headaches depending on the level and complexity of your hacks!

    Need a primer on filters and actions?
    http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/

    That tutorial is for themes, but applies to plugins as well.

    Hope that helps!


    Andrea Rennick
    Participant

    @andrea_r

    There’s built in hooks to change slugs and other things.

    BuddyPress Codex


    Jam
    Member

    @pimaniii

    Awesome, thank you! I will look into this.

    I may come back for a few questions


    Jam
    Member

    @pimaniii

    Quick question:

    So I create Bp-Custom (I am editing the slugs), but will this file be wiped out by future updates?


    @mercime
    Participant

    @mercime

    Create bp-custom.php and upload it to wp-content/plugins/ folder and no, the file won’t be wiped out be future updates. Include bp-custom.php whenever you make a backup of server files.


    Jam
    Member

    @pimaniii

    Are you sure you meant ” wp-content/plugins/” or wp-content/plugins/buddypress/?

    I already uploaded it to wp-content/plugins/buddypress with the define code

    (<?php

    define( ‘BP_ACTIVATION_SLUG’, ‘activate’ );
    define( ‘BP_ACTIVITY_SLUG’, ‘activity’ );

    etc) But with my changes…. Nothing’s changed.

    Any thoughts?


    @mercime
    Participant

    @mercime

    Upload bp-custom.php to wp-content/plugins/ folder (NOT in buddypress folder) and it’s going to work.
    e.g.
    `<?php
    define( ‘BP_ACTIVATION_SLUG’, ‘activate’ );
    define( ‘BP_ACTIVITY_SLUG’, ‘activity’ );
    ?>`


    r-a-y
    Keymaster

    @r-a-y

    It also helps to change the default slugs to something else ;)

    eg.

    `define( ‘BP_ACTIVATION_SLUG’, ‘confirm’ );
    define( ‘BP_ACTIVITY_SLUG’, ‘stream’ );
    `


    @mercime
    Participant

    @mercime

    what @r-a-y said :-)


    Jam
    Member

    @pimaniii

    I did this, but nothing changed. Is there any other setting I have to change first?


    @mercime
    Participant

    @mercime

    If you have a child theme of bp-default theme, copy over the header.php file to child theme folder. Open header.php with text editor and make changes in navigation links.

    Hey, have you tried to refresh your computer after making the changes? sometimes you need to clear the cache.


    Jam
    Member

    @pimaniii

    Ok, right now, I place exactly this code in my bp-custom.php


    <?php

    define( 'BP_ACTIVATION_SLUG', 'activate' );
    define( 'BP_ACTIVITY_SLUG', 'activity' );
    define( 'BP_BLOGS_SLUG', 'blogs' );
    define( 'BP_FORUMS_SLUG', 'forums' );
    define( 'BP_FRIENDS_SLUG', 'friends' );
    define( 'BP_GROUPS_SLUG', 'somethingnew' );
    define( 'BP_MEMBERS_SLUG', 'members' );
    define( 'BP_MESSAGES_SLUG', 'messages' );
    define( 'BP_REGISTER_SLUG', 'register' );
    define( 'BP_SEARCH_SLUG', 'search' );
    define( 'BP_SETTINGS_SLUG', 'settings' );
    define( 'BP_XPROFILE_SLUG', 'profile'

    ?>

    and uploaded it to /wp-content/plugins. I get this error:

    Parse error: syntax error, unexpected ‘;’ in /home/content/90/5329690/html/*site*/wp-content/plugins/bp-custom.php on line 17.

    Any thoughts?


    Jam
    Member

    @pimaniii

    Ok, I guess the code did not post in my last post, so here’s what I have:

    <?php

    define( ‘BP_ACTIVATION_SLUG’, ‘activate’ );
    define( ‘BP_ACTIVITY_SLUG’, ‘activity’ );
    define( ‘BP_BLOGS_SLUG’, ‘blogs’ );
    define( ‘BP_FORUMS_SLUG’, ‘forums’ );
    define( ‘BP_FRIENDS_SLUG’, ‘friends’ );
    define( ‘BP_GROUPS_SLUG’, ‘somethingnew’ );
    define( ‘BP_MEMBERS_SLUG’, ‘members’ );
    define( ‘BP_MESSAGES_SLUG’, ‘messages’ );
    define( ‘BP_REGISTER_SLUG’, ‘register’ );
    define( ‘BP_SEARCH_SLUG’, ‘search’ );
    define( ‘BP_SETTINGS_SLUG’, ‘settings’ );
    define( ‘BP_XPROFILE_SLUG’, ‘profile’

    ?>

    I successfully changed the titles, but not the slugs.


    Jam
    Member

    @pimaniii

    Not sure why the code is not showing:

    Here’s the snippet that I changed between the php tags

    define( ‘BP_GROUPS_SLUG’, ‘somethingnew’ );


    Jam
    Member

    @pimaniii

    I solved it! But I dont know if this is safe:

    I placed only the define groups directly after the line

    define(‘WPLANG’, ”);

    in wp-config.php

    Safe?


    r-a-y
    Keymaster

    @r-a-y

    It’s safe to place the code in wp-config.php.


    Jam
    Member

    @pimaniii

    Thank you

Viewing 21 replies - 1 through 21 (of 21 total)
  • The topic ‘Safe to edit BuddyPress Plugin?’ is closed to new replies.
Skip to toolbar