Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?

It’s not a pretty solution but I used the post__in attribute for this once in a custom plugin. Basically you usually define an array of attachment id’s to show in the media library. library: { type: ‘image’, post__in:[23,25,26] // or a javascript variable that contained the array of id’s } My code was originally built … Read more

add_filter ( ‘media_send_to_editor’, …) does not work on wp 3.5

‘media_send_to_editor works fine in WordPress 3.5. I did not test the above code but you don’t need to preg_match for .pdf when WordPress supports post_mime_type == ‘application/pdf; This should work better: https://gist.github.com/2176359 Just change the HTML parameters to your needs. I also advise to embed it directly as an <iframe>, native .pdf iframe browser support … Read more

How to add values to media “whitelist_options” in wp-admin/options.php template?

firstly, don’t edit core files of WordPress or your changes will be erased at the next update. in the file options.php look below this array declaration, you have this line : $whitelist_options = apply_filters( ‘whitelist_options’, $whitelist_options ); that means that you can custom this array with this code in a plugin or the theme : … Read more

Add Small Image Size to Media Settings

You can register a new image size by using add_image_size() add_image_size( string $name, int $width, int $height, bool|array $crop = false ) Parameters $name (string) (Required) Image size identifier. $width (int) (Required) Image width in pixels. $height (int) (Required) Image height in pixels. $crop (bool|array) (Optional) Whether to crop images to specified width and height … Read more

Resize the WP media Uploader iFrame

The default media box has hard coded HTML values so in order to alter the CSS for it you you have 2 options. Enqueue your own CSS and override the values Disable media-views.css completely and load a custom stylesheet. To enqueue your own style: function blah_admin_css() { wp_enqueue_style( ‘blah_admin_css’, path to your custom.css ); } … Read more

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