I'm developing my first plugin. It creates directories and save the path, level (if it is a subdirectory of other created directory) and name in a custom table, created at the activation.
The plugin has an option page where users can manager the files in each directory or create more directories and upload more files. In this option page I had to create a form with action atribute as <?php echo EASYDM_PLUGIN_URL; ?>generate-dir.php
.
The problem is when I try to use the constants like WP_CONTENT_URL
, ABSPATH
wordpress tells me they are undefined constants... just in this page of action atribute. Why?
I tried add_action( 'admin_init', 'easydm_register_settings' );
with register_setting( 'pluginPage', 'easydm_settings' );
and so on, but when I click in submit button the page redirects me to the file.php in action but as wp-admin/file.php. So, neither the first nor the second way are working for me. How can I do that?