문제

I'd been crawling the codex but can't seem to find a function that will allow me to programmatically enable the User registration system. Hopefully, I can make a custom plugin that will enable User registration system by default.

도움이 되었습니까?

해결책

You can do it by using this code:

add_action('init', 'update_anyone_can_register');
function update_anyone_can_register() {
  update_option('users_can_register', true);
}

I tested on my functions.php file and it worked as expected.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top