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

So I'm working with ThemeTrust's "reveal" theme, and there is an ajaxed in chunk-of-content that I'm really trying to change (grab custom meta fields (images) + insert into a slideshow). As far as I can tell the following piece of code grabs the content from the normal tinymce box and drops it in the #projectHolder div - but I can't figure out how to piggyback my php code on this request.

function loadProject(projectSlug) { 
// Scroll to the top of the projects    
        action : 'myajax-submit',           
        slug : projectSlug
    function( response ) {   

I suppose my answer lies somewhere in the 1500+ lines of wp-admin/admin-ajax.php but that seems awful daunting...

share|improve this question
up vote 4 down vote accepted

The function that returns the contents of that ajax request will not be in admin-ajax.php. That is the core WordPress file that handles ajax requests, but it is not used for specifying the data returned by ajax functions in themes / plugins.

In the theme (somewhere), will be a line that looks like this:

add_action('wp_ajax_myajax-submit', 'some_function_name_here');

The function called "some_function_name_here" (which will be named something different than some_function_name_here, as this is just an example) is what determines the data returned to jQuery.

Do a search in the theme files for "add_action('wp_ajax_myajax-submit'" and you should be able to find it.

If you don't find it with that search, then look for


share|improve this answer
Awesome, Thanks! I think I had it almost figured out after tracing the code a bit and reading garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress.. but you undoubtedly just saved me a fair amount of work. – Zach Lysobey May 31 '12 at 21:11

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.