WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a Ajax query to show some content, but I can't use any of my plugins functions.

Javascript :

$('#load_more').click(function() {
    var data = {
        action: 'load_more',
        id: $("input#id").val()
    jQuery.post(ajaxurl, data, function(response) {

PHP in functions.php :

function load_more(){
    $id = intval($_POST['id']);

    if(!isset($id) or !is_numeric($id)){
        echo "Error";}
    else {
        $works = plugin_function($id);
        wordpress_function_works($id, $works);}
add_action('wp_ajax_load_more', 'load_more');
add_action('wp_ajax_nopriv_load_more', 'load_more');

The Ajax works fine, it can call & work with any of my wordperss functions. But when I call a plugin function, it returns an error Call undefined function plugin_function() line...

PS: ajaxurl = /wp-admin/admin-ajax.php

share|improve this question
Is your plugin a class? – s_ha_dum May 11 '13 at 14:49
Yes it is. BTW I can call my plugin function in my theme pages – hawkidoki May 11 '13 at 14:54
Do you have helper functions? That is not correct syntax for access class methods. – s_ha_dum May 11 '13 at 14:57
The function i'm trying to call is outside of the plugin class. It's just a function. – hawkidoki May 11 '13 at 15:00
The function itself is a helper that access the plugin class. What is weird is that I can't even call this function, it's just like the plugin wasn't loaded... – hawkidoki May 11 '13 at 15:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.