PHP Callback

You can also use PHP code to render Frontend and Editor block output. Each Lazy Block has filter for custom output callback. This output will be used instead of block Frontend HTML and Editor HTML.

  • Replace my_block_slug to your block name
  • Replace my_block_output to something unique, so it will not conflict with other functions

Frontend Output Wrapper

Lazy blocks automatically add a wrapper to your frontend output code. If you want to add your own wrapper implementation with custom attributes, you can easily disable default wrapper for your block using this filter:

Look at this code part to see what exactly added to the wrapper.

Was this page helpful?