Make WordPress Core


Ignore:
Timestamp:
12/05/2012 02:34:00 AM (12 years ago)
Author:
nacin
Message:

Admin ajax: Roll back new-style error sending in set-post-thumbnail. The JS handlers know to parse an unrecognized response (like -1 or 0) as a failure. see #21776. see #22750.

File:
1 edited

Legend:

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

    r23032 r23058  
    16781678
    16791679    $post_ID = intval( $_POST['post_id'] );
    1680     if ( !current_user_can( 'edit_post', $post_ID ) ) {
    1681         $json ? wp_send_json_error() : wp_die( -1 );
    1682     }
     1680    if ( ! current_user_can( 'edit_post', $post_ID ) )
     1681        wp_die( -1 );
     1682
    16831683    $thumbnail_id = intval( $_POST['thumbnail_id'] );
    16841684
     
    16931693            $json ? wp_send_json_success( $return ) : wp_die( $return );
    16941694        } else {
    1695             $json ? wp_send_json_error() : wp_die( 0 );
     1695            wp_die( 0 );
    16961696        }
    16971697    }
     
    17021702    }
    17031703
    1704     $json ? wp_send_json_error() : wp_die( 0 );
     1704    wp_die( 0 );
    17051705}
    17061706
Note: See TracChangeset for help on using the changeset viewer.