Hi everyone @metabox.io,
Hope you all get well !
Just a suggestion, it would be great to add an action/filter before and after the template that output generated php code from the builder, for example to pass som custom functions used in code, or comment, or whatever can extend the generated php code, like so :
private function wrap_function_call() {
$before = apply_filters('rwmb_before_encoded_string', '');
$after = apply_filters('rwmb_after_encoded_string', '');
$this->encoded_string = sprintf(
'<?php
add_filter( \'rwmb_meta_boxes\', \'%1$s\' );
function %1$s( $meta_boxes ) {
$prefix = \'%3$s\';
%4$s
$meta_boxes[] = %2$s;
%5$s
return $meta_boxes;
}',
$this->function_name,
$this->encoded_string,
$this->prefix,
$before,
$after
);
return $this;
}
}
so we could call something like :
add_filter('rwmb_before_encoded_string', function($string){
return '$test = \'my lazy test\'; $mycallback = lazy_callback_function();';
});
for more improvements and automation.
i really would love it !
have a nice day
Kevin