How do I go straight to “Edit More Details” when clicking on an item in the media library?

From /wp-includes/script-loader.php: $scripts->add( ‘media-grid’, “/wp-includes/js/media-grid$suffix.js”, array( ‘media-editor’ ), false, 1 ); From wp-admin/upload.php: wp_enqueue_script( ‘media-grid’ ); wp_enqueue_script( ‘media’ ); wp_localize_script( ‘media-grid’, ‘_wpMediaGridSettings’, array( ‘adminUrl’ => parse_url( self_admin_url(), PHP_URL_PATH ), ) ); So, we can try to unregister the initial media-grid.js file and load our own version. This can be done via a plugin: <?php /** … Read more

Get url from file uploaded in Media Library

If understand your question correctly, I think this can get the job done. Use get_attachment_link instead of wp_get_attachment_url and then echo the title. <?php $attachment_id = 2582; $attachment_page = get_attachment_link( $attachment_id ); ?> <a href=”https://wordpress.stackexchange.com/questions/255020/<?php echo $attachment_page; ?>”><?php echo get_the_title($attachment_id ); ?></a>

How to change “Publish” button text for specific page

I wanted to change the Publish button’s text in the Block Editor and came across this question. With the answers given it wasn’t changing the text. With the Gutenberg update, I realized it would have to be done with JavaScript. I found this response: Changing text within the Block Editor Which I applied in my … Read more

How to count media attachments?

Use this code if you’re in the loop: $attachments = get_children( array( ‘post_parent’ => $post->ID ) ); $count = count( $attachments ); If you’re not in the loop, substitute $post->ID with the ID of the specific post. But that should count all attachments.