<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[25558] trunk/src/wp-admin/includes/ajax-actions.php: Inline documentation for hooks in wp-admin/includes/ajax-actions.php.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/25558">25558</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2013-09-21 20:46:15 +0000 (Sat, 21 Sep 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-admin/includes/ajax-actions.php.

Fixes <a href="http://core.trac.wordpress.org/ticket/25374">#25374</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ajax-actions.php (25557 => 25558)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ajax-actions.php     2013-09-21 18:51:55 UTC (rev 25557)
+++ trunk/src/wp-admin/includes/ajax-actions.php        2013-09-21 20:46:15 UTC (rev 25558)
</span><span class="lines">@@ -26,12 +26,39 @@
</span><span class="cx"> 
</span><span class="cx">  if ( ! empty($_POST['data']) ) {
</span><span class="cx">          $data = wp_unslash( (array) $_POST['data'] );
</span><ins>+
+               /**
+                * Filter Heartbeat AJAX response in no-privilege environments.
+                *
+                * @since 3.6.0
+                *
+                * @param array|object $response  The no-priv Heartbeat response object or array.
+                * @param array        $data      An array of data passed via $_POST.
+                * @param string       $screen_id The screen id.
+                */
</ins><span class="cx">           $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
</span><span class="cx">  }
</span><span class="cx"> 
</span><ins>+       /**
+        * Filter Heartbeat AJAX response when no data is passed.
+        *
+        * @since 3.6.0
+        *
+        * @param array|object $response  The Heartbeat response object or array.
+        * @param string       $screen_id The screen id.
+        */
</ins><span class="cx">   $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
</span><span class="cx"> 
</span><del>-       // Allow the transport to be replaced with long-polling easily
</del><ins>+        /**
+        * Fires when Heartbeat ticks in no-privilege environments.
+        *
+        * Allows the transport to be easily replaced with long-polling.
+        *
+        * @since 3.6.0
+        *
+        * @param array|object $response  The no-priv Heartbeat response.
+        * @param string       $screen_id The screen id.
+        */
</ins><span class="cx">   do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
</span><span class="cx"> 
</span><span class="cx">  // send the current time according to the server
</span><span class="lines">@@ -163,6 +190,7 @@
</span><span class="cx">  if ( ! is_multisite() || ! current_user_can( 'promote_users' ) || wp_is_large_network( 'users' ) )
</span><span class="cx">          wp_die( -1 );
</span><span class="cx"> 
</span><ins>+       //duplicate_hook
</ins><span class="cx">   if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
</span><span class="cx">          wp_die( -1 );
</span><span class="cx"> 
</span><span class="lines">@@ -921,6 +949,14 @@
</span><span class="cx">          }
</span><span class="cx">  }
</span><span class="cx"> 
</span><ins>+       /**
+        * Filter the Walker class used when adding nav menu items.
+        *
+        * @since 3.4.0
+        *
+        * @param string $class   The walker class to use. Default 'Walker_Nav_Menu_Edit'.
+        * @param int    $menu_id The menu id, derived from $_POST['menu'].
+        */
</ins><span class="cx">   $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
</span><span class="cx"> 
</span><span class="cx">  if ( ! class_exists( $walker_class_name ) )
</span><span class="lines">@@ -1192,7 +1228,15 @@
</span><span class="cx">  }
</span><span class="cx"> 
</span><span class="cx">  if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
</span><del>-               $item = apply_filters( 'nav_menu_meta_box_object', $items[ $_POST['item-object'] ] );
</del><ins>+                $menus_meta_box_object = $items[ $_POST['item-object'] ];
+               /**
+                * Filter a nav menu meta box object.
+                *
+                * @since 3.0.0
+                *
+                * @param object $menus_meta_box_object A nav menu meta box object, such as Page, Post, Category, Tag, etc.
+                */
+               $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
</ins><span class="cx">           ob_start();
</span><span class="cx">          call_user_func_array($callback, array(
</span><span class="cx">                  null,
</span><span class="lines">@@ -1521,10 +1565,27 @@
</span><span class="cx"> 
</span><span class="cx">  unset( $_POST['savewidgets'], $_POST['action'] );
</span><span class="cx"> 
</span><del>-       do_action('load-widgets.php');
-       do_action('widgets.php');
-       do_action('sidebar_admin_setup');
</del><ins>+        /**
+        * Fires early when editing the widgets displayed in sidebars.
+        *
+        * @since 2.8.0
+        */
+       do_action( 'load-widgets.php' );
</ins><span class="cx"> 
</span><ins>+       /**
+        * Fires early when editing the widgets displayed in sidebars.
+        *
+        * @since 2.8.0
+        */
+       do_action( 'widgets.php' );
+
+       /**
+        * Fires early when editing the widgets displayed in sidebars.
+        *
+        * @since 2.2.0
+        */
+       do_action( 'sidebar_admin_setup' );
+
</ins><span class="cx">   $id_base = $_POST['id_base'];
</span><span class="cx">  $widget_id = $_POST['widget-id'];
</span><span class="cx">  $sidebar_id = $_POST['sidebar'];
</span><span class="lines">@@ -1777,6 +1838,13 @@
</span><span class="cx">  if ( $active_lock[1] != get_current_user_id() )
</span><span class="cx">          wp_die( 0 );
</span><span class="cx"> 
</span><ins>+       /**
+        * Filter the post lock window duration.
+        *
+        * @since 3.3.0
+        *
+        * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 120.
+        */
</ins><span class="cx">   $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 120 ) + 5 ) . ':' . $active_lock[1];
</span><span class="cx">  update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
</span><span class="cx">  wp_die( 1 );
</span><span class="lines">@@ -1852,7 +1920,8 @@
</span><span class="cx">   * Filter the arguments passed to WP_Query during an AJAX call for querying attachments.
</span><span class="cx">   *
</span><span class="cx">   * @since 3.7.0
</span><del>-        * @param array $query Array of query variables.
</del><ins>+         *
+        * @param array $query An array of query variables. @see WP_Query::parse_query()
</ins><span class="cx">    */
</span><span class="cx">  $query = apply_filters( 'ajax_query_attachments_args', $query );
</span><span class="cx">  $query = new WP_Query( $query );
</span><span class="lines">@@ -1933,6 +2002,7 @@
</span><span class="cx">  if ( 'attachment' != $post['post_type'] )
</span><span class="cx">          wp_send_json_error();
</span><span class="cx"> 
</span><ins>+       //duplicate_hook
</ins><span class="cx">   $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
</span><span class="cx"> 
</span><span class="cx">  if ( isset( $post['errors'] ) ) {
</span><span class="lines">@@ -2035,6 +2105,7 @@
</span><span class="cx">          $html = stripslashes_deep( $_POST['html'] );
</span><span class="cx">  }
</span><span class="cx"> 
</span><ins>+       //duplicate_hook
</ins><span class="cx">   $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
</span><span class="cx"> 
</span><span class="cx">  wp_send_json_success( $html );
</span><span class="lines">@@ -2075,6 +2146,7 @@
</span><span class="cx">          && ( 'audio' == $ext_type || 'video' == $ext_type ) )
</span><span class="cx">                  $type = $ext_type;
</span><span class="cx"> 
</span><ins>+       //duplicate_hook
</ins><span class="cx">   $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
</span><span class="cx"> 
</span><span class="cx">  wp_send_json_success( $html );
</span><span class="lines">@@ -2105,12 +2177,39 @@
</span><span class="cx"> 
</span><span class="cx">  if ( ! empty($_POST['data']) ) {
</span><span class="cx">          $data = (array) $_POST['data'];
</span><ins>+
+               /**
+                * Filter the Heartbeat response received.
+                *
+                * @since 3.6.0
+                *
+                * @param array|object $response  The Heartbeat response object or array.
+                * @param array        $data      The $_POST data sent.
+                * @param string       $screen_id The screen id.
+                */
</ins><span class="cx">           $response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
</span><span class="cx">  }
</span><span class="cx"> 
</span><ins>+       /**
+        * Filter the Heartbeat response sent.
+        *
+        * @since 3.6.0
+        *
+        * @param array|object $response  The Heartbeat response object or array.
+        * @param string       $screen_id The screen id.
+        */
</ins><span class="cx">   $response = apply_filters( 'heartbeat_send', $response, $screen_id );
</span><span class="cx"> 
</span><del>-       // Allow the transport to be replaced with long-polling easily
</del><ins>+        /**
+        * Fires when Heartbeat ticks in logged-in environments.
+        *
+        * Allows the transport to be easily replaced with long-polling.
+        *
+        * @since 3.6.0
+        *
+        * @param array|object $response  The Heartbeat response object or array.
+        * @param string       $screen_id The screen id.
+        */
</ins><span class="cx">   do_action( 'heartbeat_tick', $response, $screen_id );
</span><span class="cx"> 
</span><span class="cx">  // Send the current time according to the server
</span></span></pre>
</div>
</div>

</body>
</html>