Make WordPress Core


Ignore:
Timestamp:
09/02/2015 06:14:14 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/edit.php.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33671. see #14530.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit.php

    r33734 r33861  
    3131    wp_die( __( 'Invalid post type' ) );
    3232
    33 if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
    34     wp_die( __( 'Cheatin’ uh?' ), 403 );
     33if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
     34    wp_die(
     35        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     36        '<p>' . __( 'You are not allowed to edit posts in this post type.' ) . '</p>',
     37        403
     38    );
     39}
    3540
    3641$wp_list_table = _get_list_table('WP_Posts_List_Table');
Note: See TracChangeset for help on using the changeset viewer.