latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Add capability automatically on registration

Home Forums Community Forum Unofficial Extensions/Hacks Add capability automatically on registration

This topic contains 0 replies, has 1 voice. Last updated by  vincenzo vecchio 3 years, 2 months ago.

Topic Author Topic
Posted: Saturday Oct 19th, 2013 at 2:37 pm #60472

Hi,

Fist of all thanks for your plugin it’s just amazing.

I have followed your guide regarding the custom capabilities to give access to a single page for a single user, so now every user has his own private page.

I found a script which creates pages automatically when a new user register on the website:

/* CREATE NEW POST WITH USER, GIVE POST USER’S NAME*/
function my_create_page($user_id){
$the_user = get_userdata($user_id);
$new_user_name = $the_user->user_login;
$my_post = array();
$my_post[‘post_title’] = $new_user_name;
$my_post[‘post_type’] = ‘post’;
$my_post[‘post_content’] = ”;
$my_post[‘post_status’] = ‘publish’;
wp_insert_post( $my_post );
}
add_action(‘user_register’, ‘my_create_page’);

I would like to know if is possible automatically create custom capabilities specific for a single user as well as the page.

Many thanks for your help.
Sorry for my english :(

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.