cyberhobo / wordpress-geo-mashup

Official repository for Geo Mashup, the plugin that makes WordPress into a GeoCMS. Documentation:
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Getting-Started
63 stars 15 forks source link

Function equivalent to "GeoMashupUserUIManager::get_instance()->print_form()" to save instead of printing #811

Open apolinario opened 6 years ago

apolinario commented 6 years ago

I'm trying to use GeoMashupUserUIManager::get_instance()->print_form() as a Contact Form 7 field, however since this function prints the content, I'm not able to use it in a return. Is there a way to save that data to a variable for posterior use instead of directly printing?

cyberhobo commented 6 years ago

There's always good old output buffering:

ob_start();
GeoMashupUserUIManager::get_instance()->print_form();
$form_content = ob_get_clean();

An alternate method returning a string would be nice to avoid these shenanigans.