Add new media uploader at frontend for wp 3.5+

Add this code to your theme’s functions.php file: function add_media_upload_scripts() { if ( is_admin() ) { return; } wp_enqueue_media(); } add_action(‘wp_enqueue_scripts’, ‘add_media_upload_scripts’); This will cause the the media upload files to load on your front end pages. If you would like to load them only on one specific page where they will be needed, you … Read more

How to upload image from front end and save in media library?

Now I have an answer for my own question.I solved this issue by using this code.I add this code just for sharing and helping other as it works for me. <input type=”file” name=”my_file_upload” id=”my_file_upload_id” class=”bg_checkbox” > function register_team_show_case_setting() { //register our settings register_setting(‘my_team_show_case_setting’, ‘my_file_upload’); } add_action(‘admin_init’, ‘register_team_show_case_setting’); Code to upload and save image: require_once( ABSPATH … Read more

Allowing all/different file type uploads

I had the same issue, it looks like WordPress isn’t able to determine the correct MIME type for RFA files, so it defaults to: ‘application/CDFV2-unknown’ Changing the MIME type to this fixed it for me. So it would be: add_filter( ‘upload_mimes’, function ( $mime_types ) { $mime_types[‘rfa’] = ‘application/CDFV2-unknown’; return $mime_types; } );

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