Make WordPress Core

Changeset 33864


Ignore:
Timestamp:
09/02/2015 06:35:05 PM (9 years ago)
Author:
SergeyBiryukov
Message:

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

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

File:
1 edited

Legend:

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

    r32642 r33864  
    5555$editing = true;
    5656
    57 if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) )
    58     wp_die( __( 'Cheatin’ uh?' ), 403 );
     57if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
     58    wp_die(
     59        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     60        '<p>' . __( 'You are not allowed to create posts as this user.' ) . '</p>',
     61        403
     62    );
     63}
    5964
    6065// Schedule auto-draft cleanup
Note: See TracChangeset for help on using the changeset viewer.