Add type to enqueued script inside plugin

There’s a filter: script_loader_tag. add_filter( ‘script_loader_tag’, ‘wpse397773_change_script_tags’, 10, 3 ); function wpse397773_change_script_tags( $tag, $handle, $src ) { $tag = ‘<script type=”text/plain” src=”‘ . $src . ‘” id=”‘ . $handle . ‘-js”></script>’; return $tag; } This should change all the <script> tags in the page (assuming they’re properly enqueued) to <script type=”text/plain”>. Update: To only change … Read more

How can I import one custom block into another?

You cannot embed blocks as react components this way, and you should not try to use other blocks as user interface components by setting innerblocks with a locked template. Instead, use 2 filters to modify the core/embed block: Use editor.BlockListBlock on core/embed to modify the edit component, wrapping it in your own component that has … Read more

Load Posts on Click via Ajax into a DIV

The short answer to your question is simply, yes it is possible. It involves code across JS and PHP and is beyond what I would be able to show in an answer here. However I did a simple Google search for “wordpress load posts with ajax” and this link is the first result. https://wpmudev.com/blog/load-posts-ajax/ I … Read more