Problem with the media library
-
Logged in users with the role “author” can use the form. There is a problem inserting images from the media library. You can upload a file and watch the upload process. Then comes the error message: “Sorry, you are not allowed to attach files to this post”.
It is possible to insert existing images via the media library.
The message comes from /wp-admin/includes/ajax-actions.php, line 2504 et sequentes:if ( ! current_user_can( 'edit_post', $post_id ) ) { echo wp_json_encode( array( 'success' => false, 'data' => array( 'message' => __( 'Sorry, you are not allowed to attach files to this post.' ), 'filename' => esc_html( $_FILES['async-upload']['name'] ), ), ) ); wp_die(); }
The error also occurs also with deactivated plugins. I echoed the capabilities of my existing dummy author and the test script confirms that [edit_post] => 1. The error no longer occurs with the user role “editor”.
Could you please help me.
- The topic ‘Problem with the media library’ is closed to new replies.