• Resolved WebEndev

    (@munman)


    Hi Gary,

    I am modifying user profile contact methods like this.

    Some of the items are already included in the plugin, and some are not.

    My question/request is:
    Would it be possible for the plugin to also account for any contact methods that are added by user function, and allow them to be displayed in the author box (along with the ones that WP Biographia already has included in the plugin)?

    Possibly have them also available as selectable options in WP Biographia settings?

    As always, great plugin!
    Thanks

    http://wordpress.org/extend/plugins/wp-biographia/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author vicchi

    (@vicchi)

    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

    Thread Starter WebEndev

    (@munman)

    Hi Gary,

    This sounds like a great way to go. My level of comprehension on this is a bit lacking on this topic though.
    Travis Smith (aka wpsmith.net) would be a great person to run this by. I’ll pass it by him and see what he thinks.

    Thanks for the quick response!

    Plugin Contributor Travis Smith

    (@wpsmith)

    I have some recommendations but it would call for some major re-writes of the plugin…

    Plugin Author vicchi

    (@vicchi)

    Hi Travis … err … should there be more to that last post of yours? 🙂

    -Gary

    Plugin Author vicchi

    (@vicchi)

    Just following up on this, with Travis’s help WP Biographia is undergoing a major rewrite, which will be v3.0. This feature request will be in that release … it kinda already is but it needs a bit of refining, documenting and testing (and for “a bit” read “a lot”).

    -Gary

    Plugin Author vicchi

    (@vicchi)

    v3.0 is now out of the door, including the features we discussed, sort of.

    -Gary

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display user_contactmethods added outside of WP Biographia’ is closed to new replies.