Hi all -
Many thanks for reading and any suggestions or feedback you have to offer!
I'm working (or maybe struggling) to set up a plugin to switch between collection titles dynamically. I've written a bit of code, but can't seem to take it to the next level; i.e. functionality :). If anyone has any suggestions on how to best proceed with the various hooks, filters, and functions I would be most grateful!
add_plugin_hook(link_to_home_page', 'collection_filter_link_to_home_page');
function collection_filter_link_to_home_page()
{
$collection = get_collection_by_id($_GET['id']))
switch ($collection) {
case 1:
$collection_title = 'Early Images of Egypt';
break;
case 2:
$collection_title = 'Copeland Railroadiana Collection';
break;
default:
$collection_title = 'BDS Omeka Instance';
break;
} return '$collection_title';
}
This is only the most recent iteration of my plugin trial, so there are probably some things that are obviously incorrect.
- I know that 'link_to_home_page' isn't in the Hooks or Filters list, however the example Hooks and Filters I've tried haven't worked either.
- I'd like to have the output appear in the
<div id="site-title>
, thus the use of the 'link_to_home_page' function. If that method is completely incorrect, can anyone offer a different suggestion?
- The use of switch() may not be ideal. Is if-elseif-else() is more appropriate?
Thanks again for reading and your suggestions.
Cheers!