Remove all video attachment, both files and post/postmeta from database?

You call wp_delete_attachment passing $attachmentid which is undefined, so it can’t work… Also the $force_delete variable isn’t defined anywhere in your code. Also there is no point in using normal loop in here – you don’t use template tags in this action, so calling the_post is just a waste of resources… add_action( ‘set_user_role’, function( $user_id, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)