Hi Bruce,
Good to hear from you. I’ve been recently thinking about adding custom action and/or filter support to WP Biographia and this sounds like a feature request that needs an action or a filter if ever there was one ??
My first thought was to add a custom filter that is called after WP Biographia renders the contact links to allow you to append your custom contact links to the contents of the wp-biographia-test
div. But that method would mean that the caller has to have precise knowledge of how that div is structured and there’s a lot of scope for breaking the formatting of the Biography Box.
So what I’m thinking is that instead, I add a custom filter that is called before WP Biographia renders the Biography Box and allows the caller to pass back an array of information about the custom links to be added. Using your pastebin example (which, by the way, is precisely how WP Biographia adds support for additional custom links), it would look something like this …
$custom_links = array (
'stumbleupon' => __('StumbleUpon'),
'googleprofile' => __('Google Profile')
);
add_filter ('wp_biographia_custom_links', 'custom_links_handler');
function custom_links_handler($links) {
return array_merge ($links, $custom_links);
}
And then in the code for WP Biographia, before I start rendering the links, I call
$new_links = apply_filters('wp_biographia_custom_links', $plugin_links);
… and then iterate over the (potentially) modified version of $new_links
which should contain the plugin’s supported links, plus your additional custom links.
Of course, this is all off of the top of my head and I’ve not even tried to see if the above code snippets actually work or not, but it should give you an indication of what I’m thinking.
So … does this sound like a valid approach to what you’re looking for? If so, then it should also be possible to add a similar approach to allow your new custom links to be controlled from within the plugin’s settings and options admin panel, but that’s stage 2 of the process I think.
Let me know …
-Gary