File Editor
Directories:
.. (Back)
screens
Files:
debug.js
jquery.knob.js
jquery.knob.min.js
jquery.twentytwenty.js
jquery.twentytwenty.min.js
punycode.js
punycode.min.js
shortpixel-media.js
shortpixel-processor.js
shortpixel-settings.js
shortpixel-tooltip.js
shortpixel-worker.js
shortpixel.js
sp-file-tree.js
sp-file-tree.min.js
Create New File
Create
Edit File: shortpixel-media.js
'use strict'; (function( $) { if (typeof (wp.media) === 'undefined' || typeof wp.media.frame === 'undefined') { return; } var ShortPixelFilter = wp.media.view.AttachmentFilters.extend ({ id: 'shortpixel-media-filter', createFilters: function() { var filters = {}; var optimizedfilter = spio_media.mediafilters.optimized; for (const [key,value] of Object.entries(optimizedfilter)) { filters[key] = { text: value, props: { 'shortpixel_status': key }, priority: 10, } }; this.filters = filters; } }); // ShortPixelFilter var AttachmentsBrowser = wp.media.view.AttachmentsBrowser; wp.media.view.AttachmentsBrowser = wp.media.view.AttachmentsBrowser.extend({ createToolbar: function() { // Make sure to load the original toolbar AttachmentsBrowser.prototype.createToolbar.call( this ); this.toolbar.set( 'ShortPixelFilter', new ShortPixelFilter({ controller: this.controller, model: this.collection.props, priority: -80 }) .render() ); } }); })( jQuery); //}); // jquery - Attachmentfilters
Save Changes
Rename File
Rename