Home / admin / Add custom user_row_actions Website, Facebook, Twitter
  • How to Add custom user_row_actions Website, Facebook, Twitter

    add-custom-user_row_actions-website-facebook-twitter

    Adding this snippet to the functions.php of your wordpress theme will display new links beside the edit button in the users panel when you mouse over. If you have already added new contact methods Facebook, Twitter, etc. you can ignore the extra fields snippet and just use the second snippet.

    ( example screenshot ) ( click code to copy )

    wordpress snippet : PHP - functions.php - extra fields

    <>
    function add_contactmethods( $contactmethods ) {
    	$contactmethods['twitter'] = 'Twitter';
    	$contactmethods['facebook'] = 'Facebook';
    	return $contactmethods;
    }
    add_filter('user_contactmethods','add_contactmethods',10,1);
    
    ( click code to copy )

    wordpress snippet : PHP - functions.php

    <>
    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 );
    

    ( WordPress codex functions, hooks, in this snippet. )

    user_contactmethods, add_filter, wp,
  • Aymenbnr

    i would like to add a custom filed but to the category page , a thumbnail field for categories !
    can you show me how to do that please ?