Meta Box
Support Forum
Support › General › Custom_html callback markup is broken
With std option all going good, but thats, what is going on, when I using callback: It appears outside .rwmb-field wrapper
Hi Jackky, let me check and fix that. Thanks for reporting!
Just looked at the code again and found that you "echo" the content instead of returning it. The callback function "must" return the content.
If your content is complicated, you should use output buffering to return it.
Give me an example please
Here it is:
function hello() { return '<b style="color:red;">Hello</b>'; }
So the callback tries to print content anyway? Why you chose this solution?
If you want the callback print the content, you can try output buffering, like this:
function hello() { ob_start(); echo 'Your content'; return ob_get_clean(); }
This makes the logic of the plugin consistent ('std' vs 'callback').