mardi 5 avril 2016

Creating custom tab with ultimatemember plugin of wordpress

I've been trying to create a custom tab for my website and am using UltimateMember plugin. After bit of google I found some code snippet that can help me do it :

/ First we need to extend main profile tabs /

add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {

 $tabs['mycustomtab'] = array(
  'name' => 'My custom tab',
  'icon' => 'um-faicon-comments',
 );
  
 return $tabs;
  
}

/ Then we just have to add content to that tab using this action /

add_action('um_profile_content_mycustomtab_default', 'um_profile_content_mycustomtab_default');
function um_profile_content_mycustomtab_default( $args ) {
 echo 'Hello world!';
}

But my question, on what file should i add this code to achieve what I need. It sounds very numb of me to ask this, but I'm seriously confused.

Thanks for any help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire