The MU forums have moved to WordPress.org

Adding SKYPE To Users Dashboard Profile (2 posts)

  1. rsgrone
    Member
    Posted 14 years ago #

    I have searched high and low, have found <?php _e('Contact Info') ?> but cannot simply locate a method to changing say "AIM" to Skype for the purposes of displaying SKYPE address instead of something that is really kind of outdated e.g. AIM

    I see where foreach (_wp_get_user_contactmethods() as $name => $desc) but where are the relationships? Which file can I simply go to and define $desc as SKYPE?

  2. DeannaS
    Member
    Posted 14 years ago #

    You don't want to hack the core that way. If you'll notice, in wp-includes\registration.php, the code sets up the contact methods and includes a filter

    function _wp_get_user_contactmethods() {
    	$user_contactmethods = array(
    		'aim' => __('AIM'),
    		'yim' => __('Yahoo IM'),
    		'jabber' => __('Jabber / Google Talk')
    	);
    	return apply_filters('user_contactmethods',$user_contactmethods);
    }

    So, you would write a plugin that returns what you want to return, instead of the standard.

    <?php
    /*
    Plugin Name: cets_modify_contact_methods
    
    Description: replaces AIM contact field with SKYPE contact field
    Author: Deanna Schneider
    Version: 1.0
    Author URI: http://deannaschneider.wordpress.com
    
    Released under the GNU General Public License (GPL2)
    http://www.gnu.org/licenses/gpl.txt
    
    This is a WordPressMU plugin (http://wordpress.org)
    */
    
    function cets_modify_contact_methods() {
    	$user_contactmethods = array(
    		'skype' => __('SKYPE'),
    		'yim' => __('Yahoo IM'),
    		'jabber' => __('Jabber / Google Talk')
    	);
    	return $user_contactmethods;
    }
    
    add_filter('user_contactmethods', 'cets_modify_contact_methods');
    
    ?>

    Save that code to a file and upload it to mu-plugins and voila - aim is skype.

About this Topic