Custom field in media library not saving, selected() function not adding “selected” to select list input type

As per outlined in the comments, by fixing a typo in my save function, and setting the third parameter in get_post_meta() to true, and false in selected() it worked liked a charm. Thanks everyone! Here’s the working code in case anyone is trying to add a select list custom field to their media manager: /* … Read more

Media Library modal customization

By default, in the Media Upload Modal Box you can only filter by Date (Month uploaded) and/or Search. To fully take advantage of the search function you should have proper filenames, alt text and description of every image when you upload them. For pagination you can go to your Media Gallery and turn on List … Read more

wordpress file upload from direct directory not working

I fix this problems with wordpress file upload method: php file: add_action( ‘wp_ajax_file_upload’, ‘file_upload_callbacks’ ); add_action( ‘wp_ajax_nopriv_file_upload’, ‘file_upload_callbacks’ ); function file_upload_callbacks() { $arr_img_ext = array(‘application/pdf’); if (in_array($_FILES[‘file’][‘type’], $arr_img_ext)) { $upload = wp_upload_bits($_FILES[“file”][“name”], null, file_get_contents($_FILES[“file”][“tmp_name”])); //$upload[‘url’] will gives you uploaded file path //var_dump($upload[‘url’]); wp_send_json( $upload[‘url’] ); } wp_die(); }

MIME types not recognized by media library

I was able to update the mime types via MySQL — here’s the update query I used: UPDATE `wp_posts` SET `post_mime_type` = ‘audio/mpeg’ WHERE `post_name` LIKE ‘%mp3%’ AND `post_mime_type` != ‘audio/mpeg’ Setting this also made the correct metadata for the files appear, and the offload plugin worked as expected. HURRAY

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