HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/wp-show-posts/admin/js/button.js
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 + '"]');
					}
				});
			}
        });
    });
})();