1
I am trying to respond to a form sent by a third party to my Wordpress. I then created a plugin to receive this form and put inside the plugin folder the form file:
<form action="http://www.meusite.com/staging/wp-content/plugins/Integrador/integrador.php" >
<input name="codigo_cliente" value="0" />
<input name="nome" value="XY" />
<input name="fone" value="99 9999.9999" />
<input name="url_xml" value="http://www.site.com/arquivo.xml" />
<input type="submit" name="registernow" value="Inscreva-se"/>
</form>
The file path is OK, the form reaches the address, but when the result is:
Fatal error: Call to Undefined Function plugin_dir_url()
I can’t even set the plugin path. Follow the code:
<?php
define('INTEGRADOR_FOLDER_NAME','Integrador');
define('INTEGRADOR_VERSION','0.0.1');
define('INTEGRADOR_PLUGIN_NAME','Integrador Plugin');
define('INTEGRADOR_SLUG','Integrador/integrador.php');
// Plugin Folder URL
define( 'INTEGRADOR_URL', plugin_dir_url( __FILE__ ) );
// Plugin Folder Path
define( 'INTEGRADOR_DIR', plugin_dir_path( __FILE__ ) );
$locale = get_locale();
load_textdomain( 'templatic', plugin_dir_path( __FILE__ ).'languages/'.$locale.'.mo' );
/*if(isset($_POST['notificationType']) && $_POST['notificationType'] == 'transaction'){*/
//Todo resto do código iremos inserir aqui.
include_once( ABSPATH . 'wp-admin/includes/plugin.php'
if ($_REQUEST['codigo_cliente'] != ''){
echo '<h1>VOU REGISTRAR ESSE USUÁRIO... AGUARDE....</h1>';
if(file_exists(INTEGRADOR_DIR.'vista/vista_registro.php')){
include_once(INTEGRADOR_DIR.'vista/vista_registro.php');
exit;
}
}
There are a lot more codes after this start.
If I access the site first in the browser and submit the form everything works(session ACTIVE). But if I send without entering the site: Error in basic functions of wordpress.
It is as if wordpress has not loaded.
Can you help me?