Support » Plugins and Hacks » Hacks » WordPress functions in plugin files

WordPress functions in plugin files

  • Good day!
    I have the following problem: in the main file plugin ‘plugin-name.php’ I can use WordPress functions (eg get_option ()), and can’t do it in additional files, there is an error ‘call to undefined function’.
    How to act properly in this case?

Viewing 3 replies - 1 through 3 (of 3 total)
  • catacaustic


    very awesome

    How are you calling the other files? Are you just adding links to the files, or have you got them set up properly using admin menus?

    I’m just include this files with ‘require_once’ in my main plugin file.



    very awesome

    So how are you getting to those pages? Through a menu or have you created your own links?

    I think you should read up on the link that I posted before. That will tell you the right way to add functions into the admin area, and I think that’s what you haven’t done yet.

    Apart from that, copy-and-paste the exact error message that you’re getting so we can see exactly what is going on.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress functions in plugin files’ is closed to new replies.