My deleted media exists jet

I founded the solution… all it’s a problem with a JS function called “slideUp” in my ajax.js (ajax’s functions for my front-end site) I don’t know the reason, but when I try to upload or a media file, WordPress try to execute this function. I change his name and the “$” for “jQuery” and now … Read more

When I’m in post editor and click on ‘Add media’, why won’t it load the media library with this code?

The correct hook to add/remove menus in admin area is admin_menu. Also, be aware that current_user_can is intented to check user capabilities, not user roles. See current_user_can documentation and notes. add_action( ‘admin_menu’, ‘my_remove_menu_pages’ ); function my_remove_menu_pages() { $user = wp_get_current_user(); if( ! empty( $user ) && in_array( “contributor”, (array) $user->roles ) ) { remove_menu_page(‘tools.php’); // … Read more