• There is a function called add_user() in /wp-admin/includes/user.php. I’m trying to call it from my plugin, but I get a “Call to undefined function” error.

    Then I include the file, and I get the same error, but with “add_action()” which add_user() calls. Then I need to include “includes/plugin.php

    Is this the right flow of development?

    Hi, this seems to be a really simple issue, however I couldn’t find the answer anywhere (google, forums)

    I’m not and expert in PHP, BTW.

    Thanks

Viewing 1 replies (of 1 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    Don’t include the WP file you want directly. Include the wp-blog-header.php file instead. That loads and includes all of WordPress. Then you can use the add_user function and so forth without issues.

Viewing 1 replies (of 1 total)

The topic ‘How to call wordpress functions?’ is closed to new replies.