• Resolved David Gard

    (@duck_boy)


    Hey all,

    I have a plugin that displays a dashboard widget, and I need some AJAX in there. I’m calling the page directly, rather than through WP as I have been advised to

    xmlhttp.open('GET', '<?php echo $plugin_folder; ?>search-results.php/?term='+term, true);

    Where $plugin_folder is –
    $plugin_folder = WP_PLUGIN_URL.'/'.str_replace(basename(__FILE__),'',plugin_basename(__FILE__));

    This means that none of the WP functions or classes are available to the PHP file that displays the results. Does any body know how to overcome this?

    Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to load a page via WordPress, not directly?’ is closed to new replies.