New answers tagged

1

You’re right...the figcaptions are encoded as html in $block['innerHTML']. You could do sth. like $tmpArray = explode('</li>',$block['innerHTML']); before your foreach loop to split the HTML string into an array that matches your gallery items and inside the loop strip_tags($tmpArray[i]); to strip away all html tags and only get the text string inside &...


0

Try wp_get_attachment_caption( $id ) for caption and get_post_meta( $id, '_wp_attachment_image_alt', true ) for alt-text


1

To validate uploads WordPress compares the MIME type of the file to the allowed MIME types for that extension. So when the file is uploaded, WordPress checks for the file extension, .svg, and the file's MIME type. It then these against the allowed MIME type for the .svg extension. If the detected MIME type does not match, then the upload is refused. The ...


1

It seems that in the recent releases of WordPress, changes were made to the mime type handling to make sure that files have the extension they say they do: https://make.wordpress.org/core/2018/12/13/backwards-compatibility-breaks-in-5-0-1/ This poses an issue for SVG files without the tag in them. SVG is actually an XML, and WordPress is now requiring to ...


0

Try out: wp.media.editor.get(wpActiveEditor).views._views[".media-frame-content"][0].views._views[""][1].collection.props.set({ignore:(+(new Date()))}) Seems like there must be an easier way but that works for me in the meantime! A more better way to do it: wp.media.frame.content.get('gallery').collection.props.set({‌​ignore: (+ new Date())});, in ...


0

After looking into this I think the answer is no. It looks like the area was built as a manner to preserve the thumbnail, or alter the thumbnail (which has a specific use case in WordPress), when making edits to an image. That's why medium, full, and large don't appear here as options. The point is "if you're messing with your image, how do you want to ...


0

I have shown your questions and i have found correction in it. You need to update your code as below. .on( 'select', function() { if(attachment.mime == "image/jpg" || attachment.mime == "image/jpge" || attachment.mime == "image/png") { var attachment = custom_uploader.state().get( 'selection' ).first().toJSON(); jQuery( '#previewImage'...


0

If you have access to the .htaccess file, a quick 301 redirect should fix that for yah! Redirect 301 /media/2018/06/somedocument.docx https://www.mycompany.com/media/2018/05/somedocument.docx (If you don't there are other ways to handle it inside the theme if you need to.)


0

add_image_size( 'medium-something', 480, 480 ); // Register the useful image size for use in Add Media modal add_filter( 'image_size_names_choose', 'your_custom_sizes' ); function your_custom_sizes( $sizes ) { return array_merge( $sizes, array( 'medium-something' => __( 'Medium Something' ), ) ); } Be aware that if the size does not ...


1

Look at replay by Roberto: https://stackoverflow.com/questions/33375823/error-dispatching-request-to-apache RequestReadTimeout handshake=0 header=20-600,MinRate=500 body=20,MinRate=500 By default Apache will stop upload after 20-30 seconds. With this directive placed into Apache config upload will continue up to 600 seconds as long as user is sending at ...


0

Thanks to @bjornredemption, I used the following code snippet: $args = array('category' => $wp_query->get_queried_object_id(), 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC', 'post_type' => array( 'post', 'attachment'),'post_status' => array( 'publish', 'inherit')); $glossaryposts = get_posts( $args ); Furthermore the ...


1

Something like this should work : $args = array ( 'post_type' => array( 'post', 'attachment'), 'category' => ARTICLE_CATID ); $query = new WP_Query( $args );


0

This should usually be a comment but I don't have enough reputation yet to comment. Your question is a little confusing which is why I am having problems trying to answer it. Are you talking about the WordPress media library or folder? One of them you can reach from inside the dashboard (under Media), the other is the physical folder on your server (...


Top 50 recent answers are included