i'm trying to write a plugin with multi files, i'm sure i did it before without a problem but now i have the problem in the subject.
in the main plugin file i included a file name - ydp-includes.php, inside of ydp-includes.php i included all the files i wanted like this:
<?php
include(dirname( __FILE__ ) .'/1.php');
include(dirname( __FILE__ ) .'/2.php');
include(dirname( __FILE__ ) .'/3.php');
include(dirname( __FILE__ ) .'/4.php');
?>
but i'm getting: Fatal error: Call to undefined function add_action(). The files are includes but for a reason i can't see at the moment wordpress doesn't see them as one plugin package and each wordpress function inside ignored.
is there another best practice way to develop multiple files wordpress plugin ? what i'm doing wrong ?
thanks