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

Query data after an Ajax insert

The function wp_insert_post() returns the post ID on success or the value 0 on error. Your PHP function should look like this : function save_enquiry_form_action() { $args = [ // Your postdata… ]; $is_post_inserted = wp_insert_post($args); if( !empty($is_post_inserted) ) { wp_send_json_success([ ‘post_id’ => $is_post_inserted, ‘post_title’ => get_the_title( $is_post_inserted ), ]); } else { wp_send_json_error(); } … Read more

Launch Media Library for specific MU site

I asked this in the WP Contributors Slack and was pointed towards this code that allows you to specify the ID of the media library you want to pull from. https://github.com/humanmade/network-media-library This doesn’t exactly do what I want, it sets a single media library for everysite to use, rather than a specific site on command.