I'm developing my first "serious" WordPress plugin using Devin Vinson's plugin boiler plate generated with this generator. Now I need to use a PHP file not present in default boilerplate as action attribute value for a form. When the form is submitted and the PHP file executed I get many fatal errors of call to undefined function for every WordPress function that I call in that file...
I already read THIS and I obviously required the PHP file with require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/ccwdpo-submit-question.php';
but I didn't solve my problem...
What's my mistake?
admin_post_{action}
hook is what you need. Here you will find usage examples. If something is unclear, ask.