Get image URL from media library “insert from url”

Got the solution…! Use fn.state(’embed’ insted of fn.on( ‘insert’ Or use Both of them fn.state(’embed’ & fn.on( ‘insert’ fn.state(’embed’).on( ‘select’, function() { var state = fn.state(), type = state.get(‘type’), embed = state.props.toJSON(); // SHOW JSON for embeded URL console.log(’embed’+JSON.stringify(embed)); });

Filter Media by Featured on Admin

We can add the Featured option as a fake mime-type with: add_filter( ‘media_view_settings’, function( $settings ) { $settings[‘mimeTypes’][‘wpsefeaturedimage’] = ‘Featured’; return $settings; }); It will show up like this: Then we can use the posts_where filter and check for our fake mime type: /** * Filter for featured images in the media library popup */ … Read more

How to set post_id to 0 when you upload image via Add media button. (async-upload.php)

Finally found an answer for this and checked it worked on my situation. How to upload image without post ID using the new media uploader? // Set post_id to 0 when Add Media button clicked jQuery(‘#insert-media-button’).on(‘click’, function( event ){ event.preventDefault(); wp.media.model.settings.post.id = 0; }); This will set all the images uploaded via Add media button … Read more

How to output images as figure/figcaption

add_theme_support( ‘html5’, array( ‘gallery’ ) ); or with another arguments such as search-form, comment-form, comment-list and caption, its call as Theme Markup Added gallery and caption support was introduced since WordPress version 3.9. As of version 3.9 WordPress uses <figure> and <figcaption> elements, instead of the generic definition list markup to output galleries. More on … Read more

unattached media files that should be attached

It’s not a problem with WordPress. It’s how it should be. If you see the image below of media library. You can see that the column name is Uploaded to which means that media file was not there before and it’s introduced or uploaded to the below mentioned post/page/etc. Since in your case it’s uploaded … Read more

Getting all URLs of uploaded images using media uploader

Got it working with a code from this question https://stackoverflow.com/questions/14847668/get-url-of-freshly-uploaded-image-from-wp3-5-media-uploader Maybe somebody will find it useful. This code logs URL of every freshly uplaoded image to console. jQuery(document).ready(function($){ $(‘#upload-btn’).click(function(e) { e.preventDefault(); var image = wp.media({ title: ‘Nahranie obsahu’, // mutiple: true if you want to upload multiple files at once multiple: true }).open() .on(‘select’, function(e){ … Read more

wordpress not generate thumnails for mp4 videos

You can output them on the front end using custom fields like this: printf( ‘<a href=”https://wordpress.stackexchange.com/questions/258892/%s”><img src=”https://wordpress.stackexchange.com/questions/258892/%s” /></a>’, get_post_meta( get_the_id(),’video_url’, true ), the_post_thumbnail_url() ); Or this if you want to use a different image for your video thumbnail printf( ‘<a href=”https://wordpress.stackexchange.com/questions/258892/%s”><img src=”https://wordpress.stackexchange.com/questions/258892/%s” /></a>’, get_post_meta( get_the_id(),’video_url’, true ), get_post_meta( get_the_id(),’video_img’, true ) );

Featured Images are not able to be set

You added your own answer in the comments section: There is only one total php warning/error: wp-admin/admin-header.php:9 – Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas13_data03/47/3056147/html/wp-includ‌​es/functions.php:413‌​8) include(‘wp-admin/edit-form-advanced.php’), require_once(‘wp-admin/admin-header.php’), header… The other half of the errors (it’s two different problems you are facing) can also be found in your comments 1) … Read more

Slow/Not Working Media Library Search

The wordpress media library do not scale well especially when searching for images. I know there was some work done in trying to make it better in the latest versions but there are some fundamental problems (flat structure) that are unlikely to be resolved without some refactoring of the whole code. If this is an … Read more

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