如何从插件中获取内容以在Wordpress模板中显示我想要的位置

There is a PHP echo statement within a widget inside the Geodirectory Plugin that I'm using on my site. The echo creates an ul/li list of each of my WordPress categories. It also creates a input checkbox for each list item that toggles display on/off of the points on a Google map for each coresponding category.

I'm simply looking to use that list somewhere else on my page outside of the map where is currently rendered.

This is the echo statement:

echo home_map_taxonomy_walker( $post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true );

I've tried changing that to be:

global $my_variable;
$my_variable = home_map_taxonomy_walker( $post_taxonomy, 0, true, 0, $map_canvas_name,$child_collapse, true );

And then echo the variable from template like:

echo $my_variable

But all I've ever managed to get is an empty <ul></ul> list and no data. I've also tried to just put the original echo statement in my template but I still get a blank list. I've also tried using the $Globals[] type variable and calling that from my template but no dice.

How do I save the list from the code inside the plugin and output it on my page where I want it?

If you can provide $post_taxonomy, $map_canvas_name and $child_collapse into the post page, you can simply echo the function. Otherwise you can try to move part of plugin code into function.php.

All depends from this 3 vars and what they represent.