WP Gutenberg – custom block with two content fields

You don’t need propstwo. It doesn’t serve any purpose. There’s only one props argument, and you use it to get access to your block’s attributes. Both header and content are attributes, so you access both of them through the same props argument: wp.blocks.registerBlockType(‘myblock/question-block’, { title: ‘Blok Pytan’, icon: ‘dashicons-welcome-write-blog’, category: ‘common’, attributes: { header: { … Read more

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