PHPStroms + Wordpress - undefined functions

Answered

Hey there,

Im want to develop a wordpress plugin, so I created a WP plugin project.

I have Wordpress running on XAMPP, I set the include path for the relevant WP installation.

I have autocomplete and I can enter functions using ctrl+Right click normally.

However, everytime I try to run the plugin specifically, I get for example: Call to undefined function add_filter()

ANy suggestions?

 

0
5 comments

Do you get this when you actually run the code?
If so, have you placed the plugin into the web root?

0
Avatar
Permanently deleted user

Hey Eugene,

Yes the plugin is the web root. 

If Wordpress is included in the correct place, so it now to call the necessary PHP files to run these WP hooks?

 

Thanks

0

Now, I paid more attention to what you said initially, and do not quite get what you mean by "run the plugins specifically". Could you please explain it?

As far as I understand, you need to run WordPress itself, and include the plugin code there: http://wordpress.stackexchange.com/questions/7398/how-to-include-php-files-in-plugins-the-correct-way

0
Avatar
Permanently deleted user

Hey Eugene, 

I figured out my mistake, Im used to working with Python so I kept the same state of mind...

Working anyhow :) Thanks!

0
Avatar
Permanently deleted user

@Guyeshet. It would have been more kind of you if you had written how you figured out your mistake. 

woogon :)

0

Please sign in to leave a comment.