I have seen this mentioned before however the other questions don't answer mine.
I have a plugin which will save information to a custom table setup through wordpress.
this plugin is only accessible through the admin panel.
rather then using the register_option alternative I need to use custom tables because there is relational data
I am able to reach my form-handler.php however it does not have access to the wordpress functions
<form method="post" action="<?php echo $this->plugin_uri.'includes/form-handler.php';?>">
<input type="submit"/>
</form>
rather I was wondering if there is a method other then registering options that would allow the functionality like so
register_form('some form', array($this, 'sanitize_form'));
and in the form call another function to identify it
<form action="options.php" method="post">
<?php form_details('some form');
<input type="submit"/>
</form>
kinda like how the settings api works is there any proper way to do this or am I going to have to hack the settings api a bit to get it to work that way...
If you call the form-handler.php file directly, it is obvious that no Wordpress code is loaded at any time. Its just your code. One thing you could do is to add the following lines at the beginning of the form handler file:
define('WP_USE_THEMES', false); // prevents Wordpress from running its usual init stuff
require_once($pathToWordpress . '/wp-blog-header.php'); // loads Wordpress
after that you can use all the core functionality WP comes with
Regards,
Stefan