How to delete Full Size options from post Add Media?

function remove_extra_image_sizes() { foreach ( get_intermediate_image_sizes() as $size ) { if ( in_array( $size, array( ‘full’ ) ) ) { remove_image_size( $size ); } } } add_action(‘init’, ‘remove_extra_image_sizes’); Ref: remove_image_size() function I think this will help you.

Inserting more than one array into same row

foreach loops over a single variable. Here you have two, so using foreach is not the right method. Or you’d have to add a $i index inside the loop to get the second variable. But there’s a simpler way: $total = count($_POST[‘file_name’]); for($i = 0; $i < $total; $i++) { $file_name = $_POST[‘file_name’][$i]; $file = … Read more

refresh media library item

I just solve this using this: // Ensure wp.media.frame exists before modifying if (wp.media && wp.media.frame) { var library = wp.media.frame.state().get(‘library’); // Set custom filter (your_key) and refresh media items library.props.set({ your_key: selectedValue }); } And create custom WordPress pre_get_posts like this: public function pre_get_posts_filter( $query ) { $request_data = isset( $_REQUEST[ ‘query’ ] ) … Read more