Edit image itself

There is no default way to do this, but this popular plugin solves the issue for most people. I have no connection to the creators of this free plugin, but I’ve used it on several sites. https://wordpress.org/plugins/enable-media-replace/

Hook into backbone to add js to wp-admin -> media library?

You can enqueue javascript files and css files like this for wp admin:- function load_custom_wp_admin_style() { wp_enqueue_script( ‘script-name’,’js/scripts.js’, array(‘jquery’), ‘3.3.5’, true ); } add_action( ‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’ ); First you need to enqueue admin scripts like below:- function my_admin_scripts() { wp_enqueue_script(‘media-upload’); wp_enqueue_script(‘thickbox’); } function my_admin_styles() { wp_enqueue_style(‘thickbox’); } for uploading attachment:- $(‘.upload_image_button’).live(‘click’,function() { formfield = $(‘#upload_image’).attr(‘name’); … Read more

Retrieve ONLY mp3s and set a variable for use in a playlist called by single.php template?

So here’s what I did to resolve this… I inserted the following code right after the loop started: <?php global $post; if( is_singular() && is_main_query() && $post->post_type === ‘download’ ) { $download = new EDD_Download( $post->ID ); $files = $download->get_files( ); $submission_attachment_ids=””; if ( is_array( $files ) ){ $first = true; foreach ( $files as … Read more

Removing delete permanently button in uploading files media

This might do the trick! css: .media-sidebar .details .edit-attachment { display: none; } .media-sidebar .details .delete-attachment { display: none; } And this: foreach( array( ‘post.php’, ‘post-new.php’ ) as $hook ) add_action( “admin_print_styles-$hook”, ‘admin_styles_so_25894288’); function admin_styles_so_25894288() { global $typenow; if( ‘post’ !== $typenow ) return; ?> <style> .media-sidebar .details .delete-attachment { display: block; } .media-sidebar .details … Read more

how to get the title, description, pictures on the page?

Try the same thing with get_children. It will get you. Here is an sample code for you. $args = array( ‘numberposts’ => -1, ‘order’ => ‘ASC’, ‘post_mime_type’ => ‘image’, ‘post_parent’ => $post->ID, ‘post_status’ => null, ‘post_type’ => ‘attachment’, ); $attachments = get_children( $args ); if ( $attachments ) { foreach ( $attachments as $attachment ) … Read more

Allow author to upload image via Media button without plugin

in the basic configuration the user role contributor and subscriber do not have the capability upload_files. The user role author has this capability. The capability upload_files gives the user the panels “Media” and “Media > Add New”. If you want another role to grant this capability, you can use the function add_cap(). Since such changes … Read more

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