0

I have made a simple code that will only save to a simple database.
I have this code:

register_activation_hook(samplePath, 'sample_install');
add_action('admin_menu', 'main');
add_action('user_admin_menu', 'main');

and a function like this :

function main(){


<?php if (current_user_can('smessage')) { 
echo("admin");}
else{
if(current_user_can('rmessage')){
echo("other user");
}
}


}

and this the sample_install function from another php file :

$wpdb->query($structure);
    $a = get_role('administrator');
    $a->add_cap('smessage'); 
    $s = get_role('author');
    $s->add_cap('rmessage');

I can see the code if I login as an adminstrator but using other roles like author, subscriber, I couldn't see the plugin any more...can someone help me with this? I'm new in using wordpress...

Thank you in advance.

Edited by Kewne

2
Contributors
1
Reply
23
Views
2 Years
Discussion Span
Last Post by asimegusta
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.