wip found how to theorically get ajax request in php but for the moment i get error 400
This commit is contained in:
@@ -55,9 +55,6 @@ function add_var_to_front($vars, $handle = "init") {
|
||||
$handle = pathinfo($handle, PATHINFO_FILENAME);
|
||||
$object_name = "php_data";
|
||||
|
||||
$ajax_url = admin_url( 'admin-ajax.php' );
|
||||
$vars["ajax_url"] = $ajax_url;
|
||||
|
||||
wp_localize_script($handle, $object_name, $vars);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,11 @@ in opposition to the methode file_get_contents()
|
||||
|
||||
https://stackoverflow.com/a/4402045/9497573
|
||||
*/
|
||||
function create_html($files, $vars) {
|
||||
function create_html($files, $vars = null) {
|
||||
$files = (array)$files;
|
||||
$html_dir = PLUGIN_DIR.'html/';
|
||||
extract($vars);
|
||||
if (!is_null($vars))
|
||||
extract($vars);
|
||||
|
||||
ob_start();
|
||||
foreach($files as $file) {
|
||||
|
||||
Reference in New Issue
Block a user