Make WordPress Core

Changeset 20866


Ignore:
Timestamp:
05/24/2012 06:40:53 AM (13 years ago)
Author:
markjaquith
Message:

Set $action for core ajax callbacks, as it will not be provided by the do_action() call until WordPress 3.5. props kurtpayne. fixes #20699

File:
1 edited

Legend:

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

    r20378 r20866  
    477477
    478478function wp_ajax_delete_post( $action ) {
     479    if ( empty( $action ) )
     480        $action = 'delete-post';
    479481    $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    480482
     
    493495
    494496function wp_ajax_trash_post( $action ) {
     497    if ( empty( $action ) )
     498        $action = 'trash-post';
    495499    $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    496500
     
    514518
    515519function wp_ajax_untrash_post( $action ) {
     520    if ( empty( $action ) )
     521        $action = 'untrash-post';
    516522    wp_ajax_trash_post( $action );
    517523}
    518524
    519525function wp_ajax_delete_page( $action ) {
     526    if ( empty( $action ) )
     527        $action = 'delete-page';
    520528    $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    521529
     
    571579
    572580function wp_ajax_add_link_category( $action ) {
     581    if ( empty( $action ) )
     582        $action = 'add-link-category';
    573583    check_ajax_referer( $action );
    574584    if ( !current_user_can( 'manage_categories' ) )
     
    691701function wp_ajax_get_comments( $action ) {
    692702    global $wp_list_table, $post_id;
     703    if ( empty( $action ) )
     704        $action = 'get-comments';
    693705
    694706    check_ajax_referer( $action );
     
    726738function wp_ajax_replyto_comment( $action ) {
    727739    global $wp_list_table, $wpdb;
     740    if ( empty( $action ) )
     741        $action = 'replyto-comment';
    728742
    729743    check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
     
    10091023function wp_ajax_add_user( $action ) {
    10101024    global $wp_list_table;
     1025    if ( empty( $action ) )
     1026        $action = 'add-user';
    10111027
    10121028    check_ajax_referer( $action );
Note: See TracChangeset for help on using the changeset viewer.