Adding Website User Data, Facebook, Twitter
Adding to user data Website, Facebook, Twitter.
The first code is added to the functions.php file, it is needed to insert new input fields. After adding the code, users will be able to specify their own Website, Facebook, Twitter.
1 2 3 4 5 6 |
function add_contactmethods( $contactmethods ) { $contactmethods['twitter'] = 'Twitter'; $contactmethods['facebook'] = 'Facebook'; return $contactmethods; } add_filter('user_contactmethods','add_contactmethods',10,1); |
To display links in the user list, as shown in the picture above, add the second code to the functions.php file of your template.
1 2 3 4 5 6 7 |
function profile_links( $actions, $user_object ) { $actions['website'] = '<a href="'.$user_object->user_url.'" target="_blank">WS</a>'; $actions['facebook'] = '<a href="'.$user_object->facebook.'" target="_blank">FB</a>'; $actions['twitter'] = '<a href="'.$user_object->twitter.'" target="_blank">TW</a>'; return $actions; } add_filter( 'user_row_actions', 'profile_links', 10, 2 ); |
/*
- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.