XMLHttpRequest of admin data to public

The short answer is “you can’t do that.” The WordPress admin content requires a user be logged in to view any of the content. If this were possible, anyone could get into the admin on your site. You will have to make this content available from the front-end by another method.

Loading two versions of same JS libary

sweetalert.js uses the global swal in both version 1.*.* and version 2.*.* of its library. Therefore if you load both js/sweetalert.min.js and js/sweetalert-latest.min.js the first one to define the global swal will be used, the second will be ignored or cause a console error. To prevent this only load one library such as: // PHP … Read more

How do I integrate a codepen?

All sorted. My theme actually had a section for custom javascript in the theme options. I added the code there and used the enqueue for the bootstrap – all working fine now.

VisualComposer/WPBakery Page Editor: Is any JS event triggered after the Edition pop-in is shown?

Solution: add an action on the tag vc_edit_form_fields_after_render. add_action( ‘vc_edit_form_fields_after_render’, function() { echo ‘<script src=”‘ . AN_URL . ‘test.js”></script>’; // Or something other }, 9 ); In the functions.php or equivalent. (Indeed, the tag vc_edit_form_fields_after_render is used by do_action( ‘vc_edit_form_fields_after_render’ ) which is located in js_composer\include\classes\editors\class-vc-edit-form-fields.php . So what you type in your add_action callable … Read more