| Server IP : 50.21.180.56 / Your IP : 216.73.216.139 Web Server : Apache System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux User : ws67922704 ( 67922704) PHP Version : 8.5.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /kunden/proc/thread-self/cwd/wp-content/plugins/wp-show-posts/admin/js/ |
Upload File : |
function wpsp_get_post_lists() {
var response = jQuery.getJSON({
type: 'POST',
url: ajaxurl,
data: {
action: 'wpsp_get_post_lists',
wpsp_nonce: wpsp_nonce
},
async: false,
dataType: 'json'
});
return response.responseJSON;
}
console.log(wpsp_get_post_lists());
(function() {
tinymce.PluginManager.add('wpsp_shortcode_button', function( editor, url ) {
editor.addButton( 'wpsp_shortcode_button', {
title: wpsp_add_posts,
icon: 'wpsp-add-icon',
onclick: function() {
editor.windowManager.open( {
width: 300,
height: 75,
title: wpsp_add_posts,
body: [
{
type: 'listbox',
name: 'wpsp_add_posts',
label: false,
'values': wpsp_get_post_lists(),
}],
onsubmit: function( e ) {
editor.insertContent( '[wp_show_posts id="' + e.data.wpsp_add_posts + '"]');
}
});
}
});
});
})();