Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP-custom in the wrong place


  • 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)

  • Jeff Sayre
    Participant

    @jeffsayre

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


    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.”


    takuya
    Participant

    @takuya

    Whatever tutorial says, Jeff says all.


    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' );


    owencutajar
    Participant

    @owencutajar

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘BP-custom in the wrong place’ is closed to new replies.
Skip to toolbar