Adding attachment custom field metadata to TinyMCE tag

Currently I’ve achieved a somewhat acceptable solution by using the do_shortcode_tag filter as mentioned in this answer, and using get_post_meta to fetch the value, as mentioned in this answer. There are (at least!) two caveats, however: The id in do_shortcode_tag‘s $attr isn’t the attachment post ID, but rather the CSS id from the original shortcode. … Read more

Picture upload issue – broken thumbnail

This is not something that can be answered without more info. What exactly means “uploaded by FTP”? Do you upload the files and then manually insert the address into the Source Code? What happens if you / the client directly tries to access the files by typing in the URL into the Browser Address Bar? … Read more

Where to store sensitive uploaded file?

Upload files at anywhere ( normally create your own folder inside wp-content/uploads folder ), you can create .htaccess file and index.html files inside the folder to restrict the files from direct access. Keep index.html blank and add deny from all text in .htaccess file.

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