Block that renders html saved in a php file

Question

I have an html snippet saved as a php file (e.g. mywidget.php):

<?php
if (!defined('ABSPATH')) exit;
?>

<div>
  foo bar baz
</div>

In a separate file mywidget-block.php, how can I create a block that “wraps” the markup from mywidget.php?

The block documentation is quite involved, and I’m hoping to create this simplest of blocks, without having to learn react. All it does is output html saved in some php file.

0
, lonix 2 years 2019-12-30T08:38:50-05:00 0 Answers 94 views 0

Leave an answer

Browse
Browse