Make WordPress Core

Ticket #33670: 33670.diff

File 33670.diff, 2.5 KB (added by kraftbj, 9 years ago)

original props to ericlewis. Modified a couple of items from the original patch. L271 had been changed from Cheatin to a different error.

  • src/wp-admin/edit-tags.php

     
    1818        wp_die( __( 'Invalid taxonomy' ) );
    1919
    2020if ( ! current_user_can( $tax->cap->manage_terms ) )
    21         wp_die( __( 'Cheatin’ uh?' ), 403 );
     21        wp_die(
     22                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     23                '<p>' . __( 'You are not allowed to manage these items.' ) . '</p>',
     24                403 );
    2225
    2326/**
    2427 * $post_type is set when the WP_Terms_List_Table instance is created
     
    5457        check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
    5558
    5659        if ( !current_user_can( $tax->cap->edit_terms ) )
    57                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     60                wp_die(
     61                        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     62                        '<p>' . __( 'You are not allowed to add this item.' ) . '</p>',
     63                        403 );
    5864
    5965        $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
    6066        $location = 'edit-tags.php?taxonomy=' . $taxonomy;
     
    9096        check_admin_referer( 'delete-tag_' . $tag_ID );
    9197
    9298        if ( !current_user_can( $tax->cap->delete_terms ) )
    93                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     99                wp_die(
     100                        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     101                        '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>',
     102                        403 );
    94103
    95104        wp_delete_term( $tag_ID, $taxonomy );
    96105
     
    102111        check_admin_referer( 'bulk-tags' );
    103112
    104113        if ( !current_user_can( $tax->cap->delete_terms ) )
    105                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     114                wp_die(
     115                        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     116                        '<p>' . __( 'You are not allowed to delete these items.' ) . '</p>',
     117                        403 );
    106118
    107119        $tags = (array) $_REQUEST['delete_tags'];
    108120        foreach ( $tags as $tag_ID ) {
     
    140152        check_admin_referer( 'update-tag_' . $tag_ID );
    141153
    142154        if ( !current_user_can( $tax->cap->edit_terms ) )
    143                 wp_die( __( 'Cheatin&#8217; uh?' ), 403 );
     155                wp_die(
     156                        '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     157                        '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>',
     158                        403 );
    144159
    145160        $tag = get_term( $tag_ID, $taxonomy );
    146161        if ( ! $tag )
     
    253268require_once( ABSPATH . 'wp-admin/admin-header.php' );
    254269
    255270if ( !current_user_can($tax->cap->edit_terms) )
    256         wp_die( __('You are not allowed to edit this item.') );
     271        wp_die(
     272                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
     273                '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>',
     274                403 );
    257275
    258276$messages = array();
    259277$messages['_item'] = array(