Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_ajax_{$action}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
140      _wp_ajax_menu_quick_search( $_REQUEST );
141
142      exit;
143      break;
144 case 'oembed-cache' :
145      $return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0';
146      die( $return );
147      break;
148 default :
149      do_action( 'wp_ajax_' . $_GET['action'] );
150      die('0');
151      break;
152 endswitch;
153 endif;
154
155 /**
156  * Sends back current comment total and new page links if they need to be updated.
157  *
158  * Contrary to normal success AJAX response ("1"), die with time() on success.
 
Line Code
1522           $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
1523           if ( !empty( $thumbnail_html ) ) {
1524                update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id );
1525                die( _wp_post_thumbnail_html( $thumbnail_id ) );
1526           }
1527      }
1528      die( '0' );
1529      break;
1530 default :
1531      do_action( 'wp_ajax_' . $_POST['action'] );
1532      die('0');
1533      break;
1534 endswitch;
1535 ?>
1536