Skip to:
Content
Pages
Categories
Search
Top
Bottom

Calling a php function which is in its own file.


  • yagobg
    Participant

    @yagobg

    Hi All,

    Need some help regarding buddypress. I have some custom code which is inside buddypress pages via a plugin “PHP Execution”. Everything is working fine but I need to make my code modular (call functions that are in their own file. So my question is where do I put all my .php so I can reference to them from the buddypress page. By searching google got to bp-custom.php is that the only file I can have to insert custom code. And if I insert code in taht file do I just reference the function name or have to reference the file ?

    Thanks

Viewing 1 replies (of 1 total)

  • Brajesh Singh
    Participant

    @sbrajesh

    You can either put it in bp-custom.php or the functions.php of your theme.

    The advantage of using bp-custom.php is the functions will be always available(even on multisite) and since this file is loaded before anything else in BuddyPress, you don’t have to worry about the availability of your functions.

    If you put your code in any of these two files, you don’t need to reference/include these files. They are included automatically.

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Calling a php function which is in its own file.’ is closed to new replies.
Skip to toolbar