I’m doing some work for a new client (non-tech, their former tech person left). Their version of WordPress is 4.3.2.

I have an admin account and I’m unable to edit existing posts. I can create new ones and edit those, but I’m unable to edit existing posts.

The edit links don’t show and if I put in a url I construct myself like (/wp-admin/post.php?post=1375&action=edit)

I get this error message:

You are not allowed to edit this item.

I have full access to the filesystem, database, etc. how do I fix this issue so I can edit existing posts through the WordPress UX?

I see the user Role Editor plugin is installed.

I activated it and updated it. It shows that administrators have full permissions.

administrators have full permissions

1 Answer
1

I fixed this by editing /wp-includes/capabilities.php

The code was

function current_user_can( $capability ) {
    $current_user = wp_get_current_user();

    if ( empty( $current_user ) )
        return false;

    $args = array_slice( func_get_args(), 1 );
    $args = array_merge( array( $capability ), $args );

    return call_user_func_array( array( $current_user, 'has_cap' ), $args );
}

and I changed it to

function current_user_can( $capability ) {
    $current_user = wp_get_current_user();

    if ( empty( $current_user ) )
        return false;

    if (is_admin())
        return true;
    $args = array_slice( func_get_args(), 1 );
    $args = array_merge( array( $capability ), $args );

    return call_user_func_array( array( $current_user, 'has_cap' ), $args );
}

Leave a Reply

Your email address will not be published. Required fields are marked *