Unable to delete images in Media Library
Unable to delete images in Media Library
Unable to delete images in Media Library
This isn’t the answer to my question, but ended up being the workaround I used. Settle for a subdomain multi-site. I changed it over to mu.site.com/ and sub-site.site.com/, updated htaccess to work for a subdomain install and everything just started working. I’m not sure why the subdirectory multi-site installed on a subdomain caused an issue, … Read more
You will have to create two different media modals that are fired depending on your click event. Here is some code from a recent project where I added these buttons to the tinyMCE visual editor: jQuery(document).ready(function($){ $(document).on(‘click’, ‘.mce-my_upload_button’, upload_image_tinymce); $(document).on(‘click’, ‘.mce-my_upload_pdf_button’, upload_pdf_tinymce); function upload_image_tinymce(e) { e.preventDefault(); var $input_field = $(‘.mce-my_input_image’); var custom_uploader = wp.media.frames.file_frame = … Read more
WordPress has a filter image_send_to_editor which lets you modify the html that is generated by the media editor. Usage: add_filter (‘image_send_to_editor’, ‘wpse264886_filter_image’, 10, 8); function wpse264886_filter_image ($html, $id, $caption, $title, $align, $url, $size, $alt) { $html=”<span> … </span>” . $html; return $html; } This will insert the spans always, however, not only when there is … Read more
The setting associated with the media control will have the ID for the attachment stored as its value. Assuming you have registered a setting for your control like this: $wp_customize->add_setting( ‘resume’, array( ‘type’ => ‘option’, // … ) ); Then you would obtain the attachment ID just by reading from the option, like: get_option( ‘resume’ … Read more
WP Cli + xargs fails
This is expected, title is no longer used. Have a look at where the function is called in source that eventually fires that filter: $title=””; // We no longer insert title tags into <img> tags, as they are redundant.
It sounds like you are attempting to push too much data at one time. GoDaddy may be terminating the connection because of a size limit per request or the upload is taking longer than they allow (because it is so large.) In either case it is a sign the amount of data is too large. … Read more
To iterate over media you must first call to WP using your client: allwp_media = client.call(media.GetMediaLibrary())
Unless I’ve missed something in the flow of this, It seems the mentioned WPSE answer is correct. The filter hook referenced, wp_save_image_editor_file, is applied in the wp_save_image_file() function when dealing with an instance of WP_Image_Editor class; giving access to $filename (trac link for below): * @param mixed $override Value to return instead of saving. Default … Read more