Enabling users to upload files

I have added this code to enable everyone to add files function allow_own_attachments( $user_caps, $req_caps, $args, $UserObj ) { if ( empty($args[2]) ) { return $user_caps; // nothing to check } $post = get_post( $args[2] ); // post_id was passed here if (is_object($post)){ //check if $post is an object. If it is’t checked the code … Read more

remove_accents does not seem to work (when used inside sanitize_file_name filter)

I’ve just got an advice on Twitter from Daniel Střelec to simply use sanitize_title – which is a better solution anyway, as it removes whitespace and other non-ideal characters for filename. Use it this way: add_filter(‘sanitize_file_name’, ‘sanitize_title’); I’m keeping the question opened though, as what I’ve described above sounds like a WP bug to me. … Read more

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