WordPress                
            user_contactmethodsフィルタフックでユーザの連絡先情報を追加/削除する
        
        
            
    サーチ…
人気のあるソーシャルネットワークを有効にする
function social_profiles( $contactmethods ) {
    
    $contactmethods['facebook_profile']  = 'Facebook Profile URL';
    $contactmethods['twitter_profile']   = 'Twitter Profile URL';
    $contactmethods['google_profile']    = 'Google Profile URL';
    $contactmethods['linkedin_profile']  = 'Linkedin Profile URL';
    $contactmethods['github_profile']    = 'GitHub Profile URL';
    $contactmethods['behance_profile']   = 'Behance Profile URL';
    $contactmethods['dribbble_profile']  = 'Dribbble Profile URL';
    $contactmethods['stack_profile']     = 'Stack Exchange Profile URL';
    $contactmethods['twitch_profile']    = 'Twitch Profile URL';
    $contactmethods['angellist_profile'] = 'AngelList Profile URL';
    
    return $contactmethods;
}
add_filter( 'user_contactmethods', 'social_profiles', 10, 1);
このファイルはダッシュボードに表示されます:
そして、これはあなたがコードでそれを取得する方法です
<?php $user_stack_exchange = get_the_author_meta( 'stack_profile' ); ?>
連絡方法の削除
function remove_contact_methods( $contactmethods ) {
    
    unset($contactmethods['facebook_profile']);
    unset($contactmethods['twitter_profile']);
   
    return $contactmethods;
}
add_filter( 'user_contactmethods', 'remove_contact_methods', 10, 1);
Modified text is an extract of the original Stack Overflow Documentation
        ライセンスを受けた CC BY-SA 3.0
        所属していない Stack Overflow
    