Keeping CSS model open after form submission

A combination of PHP and JS will do it. Have your page listen for the presence of gform_submit which Gravity Forms includes as a hidden field on all forms by default. if(!empty($_POST[‘gform_submit’])) { // now here comes your javascript } For the JS, set modal-state checked. This way on page load, if the form has … Read more

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

Capability to prevent upload of files

You can try with this: function remove_media_tabs($strings) { unset($strings[“insertFromUrlTitle”]); unset($strings[“setFeaturedImageTitle”]); unset($strings[“createGalleryTitle”]); unset($strings[“uploadFilesTitle”]); return $strings; } add_filter(‘media_view_strings’,’remove_media_tabs’); This will remove ‘Upload file’ and ‘Insert from URL’ links when you open insert media screen, so user will be able only to select images or whatever that is already in media library. For more things you can do … Read more

Passing jQuery into the WordPress media uploader

As you mention the media uploader dynamically renders the images “on demand” and there doesn’t seem to be an event one can target to add the class. A gross way to do it is to override the wp.media.view.Attachment.Library.className attribute (before the frame is created) to return the extra class if the model id is in … Read more

Get File Object from wp.Uploader

You can’t hook it directly as wp.Uploader doesn’t expose it but you can use its init() to hook its internal pluploader instance: add_action( ‘admin_print_footer_scripts’, function () { ?> <script type=”text/javascript”> (function ($) { if (typeof wp.Uploader === ‘function’) { $.extend( wp.Uploader.prototype, { init : function() { // plupload ‘PostInit’ this.uploader.bind(‘BeforeUpload’, function(file) { console.log(‘BeforeUpload file=%o’, file); … Read more

How to open the add media dialogue it in a certain state / tab?

Suppose you want to open the modal to the create gallery section: var options = { frame: ‘post’, state: ‘gallery’, title: wp.media.view.l10n.createGalleryTitle, multiple: true }; var frame = wp.media.editor.open(null,options) If you want something else, I suggest you search through the core js source to change the Library ID as appropriate for the section you need.

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