| Server IP : 89.248.107.232 / Your IP : 216.73.217.70 Web Server : Apache System : Linux host2.kasilh.com 5.14.0-687.36.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 7 05:40:49 EDT 2026 x86_64 User : seg ( 10005) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/seg-sa.es/serinco.es/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 + '"]');
}
});
}
});
});
})();