Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP-custom in the wrong place

  • Avatar of owencutajar
    owencutajar
    Participant

    @owencutajar

    I tried implementing the tutorial on how to change the Blogs menu which involved creating a bp-custom.php and putting it in the BuddyPress folder. Turns out that the code looks for this in the plugins folder:

    bp-core.php says:

    11 if ( file_exists( WP_PLUGIN_DIR . ‘/bp-custom.php’ ) )

    12 require( WP_PLUGIN_DIR . ‘/bp-custom.php’ );

    Not sure if WP_PLUGIN_DIR should read BP_PLUGIN_DIR or if the tutorial is wrong

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    You place your bp-custom.php in /plugin/, not /plugin/buddypress/.

    Avatar of owencutajar
    owencutajar
    Participant

    @owencutajar

    The “modifying the WordPress bar” tutorial says

    “Any custom code that we create can be placed in a file called bp-custom.php. It gets loaded with all the rest of bp automatically by bp during each page load. If you don’t have one already then create one in /plugins/buddypress.”

    Avatar of wpmubp.org
    wpmubp
    Participant

    @takuya

    Whatever tutorial says, Jeff says all.

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    The codebase is the final authority. Look at line 9 of bp-core.php. It tells you exactly what to do.

    /* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it
    will be loaded before anything else. */
    if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) )
    require( WP_PLUGIN_DIR . '/bp-custom.php' );

    Avatar of owencutajar
    owencutajar
    Participant

    @owencutajar

    *chuckle* .. codebase has to be final authority .. otherwise it won’t work ;)

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

You must be logged in to reply to this topic.