how to invoke wordpress API from other existing PHP system

You can add the following snippet at the start of your PHP file to load WordPress in it. define( ‘WP_USE_THEMES’, false ); require(‘wp-blog-header.php’); // chage the path to match your WP directory //the rest of your code here EDIT: Alternatively, you could use wp-load.php instead of wp-blog-header.php. define( ‘WP_USE_THEMES’, false ); require(‘wp-load.php’); // chage the … Read more

White screen when activating plugin that sends form via WordPress

you should remove: require(‘http://solutionsagencia.com.br/comparasaude/wp-load.php’); and use: require(ABSPATH.’wp-includes/pluggable.php’); p.s. I advice you, these executions should be hooked in ‘init’, like: add_action(‘init’, function(){ $para = “[email protected]”; $assunto = “Assunto” . $nome; $conteudo = “<b>Nome:</b> {$nome}” . “<b>Email:</b> {$email}” . $headers = array( ‘Reply-To’ => $name . ‘<‘ . $email . ‘>’, ); $status = wp_mail( $para, $assunto, … Read more

jQuery in WordPress Plugin

You should place the .js file into your plugin directory (it can be root or any other folder like assets or js). To enqueue JS and CSS files in the front-end: function wp_357866_enqueue_frontend() { wp_enqueue_script(‘your-script’, get_template_directory_uri() . ‘/path/to/js/your-script.js’, array(), null, true); // You should set the last parameter to ‘true’ to load JS in the … Read more