Front-End Upload media with category

Maybe you can assign attachment to those categories after upload? Check this example. function add_category_automatically($post_ID) { $attach = get_post($post_ID); if ($attach->post_parent) { $cats = get_the_category()($attach->post_parent); foreach ($cats as $cat) { wp_set_object_terms($post_ID, $cat->slug, ‘category’, true); } } } add_action(‘add_attachment’, ‘add_category_automatically’); Source

How to Protect Uploads, if User is not Logged In?

Only checking if the cookie exists, is not much of a strict protection. To get a stronger protection, you can pass or “proxy” all requests to the uploaded folder (exemplary uploads in the following example) through a php script: RewriteCond %{REQUEST_FILENAME} -s RewriteRule ^wp-content/uploads/(.*)$ dl-file.php?file=$1 [QSA,L] All requests to uploaded files (which includes images in … Read more

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