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
106                update_site_option('can_compress_scripts', 0);
107           } elseif ( 'yes' == $_GET['test'] ) {
108                update_site_option('can_compress_scripts', 1);
109           }
110      }
111
112      die('0');
113      break;
114 default :
115      do_action( 'wp_ajax_' . $_GET['action'] );
116      die('0');
117      break;
118 endswitch;
119 endif;
120
121 /**
122  * Sends back current comment total and new page links if they need to be updated.
123  *
124  * Contrary to normal success AJAX response ("1"), die with time() on success.
 
Line Code
1337      if ( !empty($_POST['add_new']) )
1338           die();
1339
1340      if ( $form = $wp_registered_widget_controls[$widget_id] )
1341           call_user_func_array( $form['callback'], $form['params'] );
1342
1343      die();
1344      break;
1345 default :
1346      do_action( 'wp_ajax_' . $_POST['action'] );
1347      die('0');
1348      break;
1349 endswitch;
1350 ?>
1351