This commit is contained in:
Sven Steinert
2026-05-13 11:57:52 +02:00
parent 6abf6f9c3d
commit f4511b9213
76 changed files with 4494 additions and 1940 deletions

View File

@@ -0,0 +1,32 @@
(function ($) {
const button = $('#kb-markdown-upload-theme-css');
const input = $('#custom_theme_css_url');
if (!button.length || !input.length || typeof wp === 'undefined' || !wp.media) {
return;
}
button.on('click', function (event) {
event.preventDefault();
const frame = wp.media({
title: 'Select theme.css',
button: {
text: 'Use this CSS file'
},
multiple: false,
library: {
type: ['text/css', 'text/plain']
}
});
frame.on('select', function () {
const attachment = frame.state().get('selection').first().toJSON();
if (attachment && attachment.url) {
input.val(attachment.url);
}
});
frame.open();
});
}(jQuery));