Thank you for reaching out — and sincere apologies for the unexpected change in behavior.
Starting from a recent update, we implemented a security hardening change based on feedback from a security researcher (Mohamad Nour Almujarkesh). You can find the relevant note in the “Security Hardening” section of our changelog.
What Changed?
Previously, users with the Editor role could access and manage video posts. However, because the Editor role includes the unfiltered_html capability (which can introduce potential security risks), we have now disabled backend access to video content for editors by default.
How to Restore Editor Access
If you trust your editors and would like to re-enable their access, you can do so programmatically by adding the following code to your theme’s functions.php file:
function override_aiovg_videos_post_type_args( $args, $post_type ) {
if ( ! current_user_can( 'manage_aiovg_options' ) ) { // Not an admin
if ( current_user_can( 'editor' ) ) {
$args['show_in_menu'] = true;
$args['menu_position'] = 5;
$args['menu_icon'] = 'dashicons-playlist-video';
}
}
return $args;
}
add_filter( 'register_post_type_args', 'override_aiovg_videos_post_type_args', 11, 2 );
This will ensure that Editors can once again see and edit video posts from the admin dashboard.
Hope this solved your issue!
hi @wpvideogallery thanks for the explanation and the custom code. I have tested your code snippet and while yes, it does re-enable editor permissions, it also seems to randomly enable other unexpected admin menu items? See screenshots for reference, this is very strange.
This is what the admin dashboard looks like before I add your snippet:
https://imgur.com/hsfUqL2
And after I add your code snippet, I get a whole bunch of unexpected menu items in addition to the Video Gallery?
https://imgur.com/A7wXfxJ
I also notice that it changes the dashicon for the DOWNLOADS menu item as well…
Any idea why this would happen?
-
This reply was modified 3 months, 3 weeks ago by
sarahsas.
Aah. Sorry about that. Kindly try using the updated code below:
function override_aiovg_videos_post_type_args( $args, $post_type ) {
if ( 'aiovg_videos' !== $post_type ) {
return $args;
}
if ( ! current_user_can( 'manage_aiovg_options' ) ) { // Not an admin
if ( current_user_can( 'editor' ) ) {
$args['show_in_menu'] = true;
$args['menu_position'] = 5;
$args['menu_icon'] = 'dashicons-playlist-video';
}
}
return $args;
}
add_filter( 'register_post_type_args', 'override_aiovg_videos_post_type_args', 11, 2 );
Wonderful @wpvideogallery that new version did the trick. Thank you!