[Plugin: Flexo Archives] Add Parameter to Return Instead of Echo Results
-
For those who want to call this widget (in standalone mode) from another custom plugin, I suggest this alteration at the end of flexo_archives_widget.php:
function flexo_standalone_archives ($echo=TRUE) { $archives = new FlexoArchives(); if ($archives->standalone_enabled()) { $output = $archives->build_archives_list( $archives->standalone_count_enabled(), $archives->yearly_total_enabled() ); if($echo){ echo $output; } else { return $output; } } }
I’ve discovered the problem with creating an archives page (via creating an archives.php template in a theme’s folder) is that sometimes when you perform an update to a theme via the WP control panel, the process wipes out the custom files you’d created. To overcome that and future-proof the customization, I created a new plugin which simply adds a shortcode which in turn calls the above function to output the list. However, to maintain the correct order of content, the list needs to be returned instead of echoed.
- The topic ‘[Plugin: Flexo Archives] Add Parameter to Return Instead of Echo Results’ is closed to new replies.