Hi both, so this is what we have currently in our code:
Layouts
Actions:
do_action( "custom-layouts\layout\before_render", $settings, $this->name );
do_action( "custom-layouts\layout\after_render", $settings, $this->name );
Filters
$settings = apply_filters( 'custom-layouts\layout\render_args', $settings, $this->name );
$output = apply_filters( "custom-layouts\layout\render_output", $output, $this->name, $settings );
Templates
Filters:
$settings = apply_filters( 'custom-layouts\template\render_args', $settings, $this->name );
$output = apply_filters( "custom-layouts\template\render_output", $output, $this->name, $settings );
Actions
do_action( "custom-layouts\template\before_render", $settings, $this->name );
do_action( "custom-layouts\template\after_render", $settings, $this->name );
—-
I think the actions speak for themselves… For the filters, for layouts and templates you have 2:
render_args
Here you can update $settings argument used to generate the render
render_output
This contains the full html of what will be printed to screen, so you can manipulate this where necessary.
I think after reading both your comments, it would also be good to add the same actions/filters for individual elements?
– So we have a before/after render element action
– And we can update the args / output of each using a filters
What do you think?
(I am in the process of writing all this up on a new site we are building)
-
This reply was modified 3 years, 8 months ago by Code Amp.
-
This reply was modified 3 years, 8 months ago by Code Amp.