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

multiple image upload using wp_enqueue_media

I solved it here is my code: image.on(‘select’, function() { let selection = image.state().get(‘selection’); let _getImage = []; selection.map( function( getImage ) { _getImage.push(getImage.toJSON()) getImage = getImage.toJSON(); jQuery(“#show-image”).after(“<img src=”https://wordpress.stackexchange.com/questions/336524/+getImage.url+” style=”height:50px;width:50px;”/>”); }) jQuery(“#trade_pic”).after(“<input type=”hidden” name=”trade_pic” value=””+_getImage.map(val=> val.url)+””/>”) }); image.open();

Images missing from the media folder

This should usually be a comment but I don’t have enough reputation yet to comment. Your question is a little confusing which is why I am having problems trying to answer it. Are you talking about the WordPress media library or folder? One of them you can reach from inside the dashboard (under Media), the … Read more

301 Redirect Link to Media

If you have access to the .htaccess file, a quick 301 redirect should fix that for yah! Redirect 301 /media/2018/06/somedocument.docx https://www.mycompany.com/media/2018/05/somedocument.docx (If you don’t there are other ways to handle it inside the theme if you need to.)

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