Make WordPress Core

Changeset 25558


Ignore:
Timestamp:
09/21/2013 08:46:15 PM (12 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/includes/ajax-actions.php.

Fixes #25374.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r25452 r25558  
    2727    if ( ! empty($_POST['data']) ) {
    2828        $data = wp_unslash( (array) $_POST['data'] );
     29
     30        /**
     31         * Filter Heartbeat AJAX response in no-privilege environments.
     32         *
     33         * @since 3.6.0
     34         *
     35         * @param array|object $response  The no-priv Heartbeat response object or array.
     36         * @param array        $data      An array of data passed via $_POST.
     37         * @param string       $screen_id The screen id.
     38         */
    2939        $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
    3040    }
    3141
     42    /**
     43     * Filter Heartbeat AJAX response when no data is passed.
     44     *
     45     * @since 3.6.0
     46     *
     47     * @param array|object $response  The Heartbeat response object or array.
     48     * @param string       $screen_id The screen id.
     49     */
    3250    $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
    3351
    34     // Allow the transport to be replaced with long-polling easily
     52    /**
     53     * Fires when Heartbeat ticks in no-privilege environments.
     54     *
     55     * Allows the transport to be easily replaced with long-polling.
     56     *
     57     * @since 3.6.0
     58     *
     59     * @param array|object $response  The no-priv Heartbeat response.
     60     * @param string       $screen_id The screen id.
     61     */
    3562    do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
    3663
     
    164191        wp_die( -1 );
    165192
     193    //duplicate_hook
    166194    if ( ! is_super_admin() && ! apply_filters( 'autocomplete_users_for_site_admins', false ) )
    167195        wp_die( -1 );
     
    922950    }
    923951
     952    /**
     953     * Filter the Walker class used when adding nav menu items.
     954     *
     955     * @since 3.4.0
     956     *
     957     * @param string $class   The walker class to use. Default 'Walker_Nav_Menu_Edit'.
     958     * @param int    $menu_id The menu id, derived from $_POST['menu'].
     959     */
    924960    $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
    925961
     
    11931229
    11941230    if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
    1195         $item = apply_filters( 'nav_menu_meta_box_object', $items[ $_POST['item-object'] ] );
     1231        $menus_meta_box_object = $items[ $_POST['item-object'] ];
     1232        /**
     1233         * Filter a nav menu meta box object.
     1234         *
     1235         * @since 3.0.0
     1236         *
     1237         * @param object $menus_meta_box_object A nav menu meta box object, such as Page, Post, Category, Tag, etc.
     1238         */
     1239        $item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
    11961240        ob_start();
    11971241        call_user_func_array($callback, array(
     
    15221566    unset( $_POST['savewidgets'], $_POST['action'] );
    15231567
    1524     do_action('load-widgets.php');
    1525     do_action('widgets.php');
    1526     do_action('sidebar_admin_setup');
     1568    /**
     1569     * Fires early when editing the widgets displayed in sidebars.
     1570     *
     1571     * @since 2.8.0
     1572     */
     1573    do_action( 'load-widgets.php' );
     1574
     1575    /**
     1576     * Fires early when editing the widgets displayed in sidebars.
     1577     *
     1578     * @since 2.8.0
     1579     */
     1580    do_action( 'widgets.php' );
     1581
     1582    /**
     1583     * Fires early when editing the widgets displayed in sidebars.
     1584     *
     1585     * @since 2.2.0
     1586     */
     1587    do_action( 'sidebar_admin_setup' );
    15271588
    15281589    $id_base = $_POST['id_base'];
     
    17781839        wp_die( 0 );
    17791840
     1841    /**
     1842     * Filter the post lock window duration.
     1843     *
     1844     * @since 3.3.0
     1845     *
     1846     * @param int $interval The interval in seconds the post lock duration should last, plus 5 seconds. Default 120.
     1847     */
    17801848    $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 120 ) + 5 ) . ':' . $active_lock[1];
    17811849    update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
     
    18531921     *
    18541922     * @since 3.7.0
    1855      * @param array $query Array of query variables.
     1923     *
     1924     * @param array $query An array of query variables. @see WP_Query::parse_query()
    18561925     */
    18571926    $query = apply_filters( 'ajax_query_attachments_args', $query );
     
    19342003        wp_send_json_error();
    19352004
     2005    //duplicate_hook
    19362006    $post = apply_filters( 'attachment_fields_to_save', $post, $attachment_data );
    19372007
     
    20362106    }
    20372107
     2108    //duplicate_hook
    20382109    $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
    20392110
     
    20762147            $type = $ext_type;
    20772148
     2149    //duplicate_hook
    20782150    $html = apply_filters( $type . '_send_to_editor_url', $html, $src, $title );
    20792151
     
    21062178    if ( ! empty($_POST['data']) ) {
    21072179        $data = (array) $_POST['data'];
     2180
     2181        /**
     2182         * Filter the Heartbeat response received.
     2183         *
     2184         * @since 3.6.0
     2185         *
     2186         * @param array|object $response  The Heartbeat response object or array.
     2187         * @param array        $data      The $_POST data sent.
     2188         * @param string       $screen_id The screen id.
     2189         */
    21082190        $response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
    21092191    }
    21102192
     2193    /**
     2194     * Filter the Heartbeat response sent.
     2195     *
     2196     * @since 3.6.0
     2197     *
     2198     * @param array|object $response  The Heartbeat response object or array.
     2199     * @param string       $screen_id The screen id.
     2200     */
    21112201    $response = apply_filters( 'heartbeat_send', $response, $screen_id );
    21122202
    2113     // Allow the transport to be replaced with long-polling easily
     2203    /**
     2204     * Fires when Heartbeat ticks in logged-in environments.
     2205     *
     2206     * Allows the transport to be easily replaced with long-polling.
     2207     *
     2208     * @since 3.6.0
     2209     *
     2210     * @param array|object $response  The Heartbeat response object or array.
     2211     * @param string       $screen_id The screen id.
     2212     */
    21142213    do_action( 'heartbeat_tick', $response, $screen_id );
    21152214
Note: See TracChangeset for help on using the changeset viewer.