File "selector.js"
Full Path: /home/tekvhqgl/public_html/dev2024_old_skip/wp-content/plugins/presto-player/src/elementor/selector.js
File size: 612 bytes
MIME-type: text/plain
Charset: utf-8
export const url = `${prestoEditorData?.root}${prestoEditorData?.wpVersionString}presto-videos`;
export default function ($element) {
$element.select2({
ajax: {
url,
dataType: "json",
headers: {
"X-WP-Nonce": prestoEditorData.nonce,
},
data: function (params) {
return {
search: params.term,
};
},
processResults: function (data) {
return {
results: jQuery.map(data, function (obj) {
return { id: obj.id, text: obj?.title?.raw || "Untitled Video" };
}),
};
},
},
});
}