Created
March 10, 2012 17:54
-
-
Save chrisguitarguy/2012290 to your computer and use it in GitHub Desktop.
Don't allow people to view the default WordPress registration page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Registration Redirect | |
Description: Don't allow people to view the default registration page | |
Author: Christopher Davis | |
Author URI: http://christopherdavis.me | |
License: GPL2 | |
*/ | |
add_action( 'login_form_register', 'wpse45134_catch_register' ); | |
/** | |
* Redirects visitors to `wp-login.php?action=register` to | |
* `site.com/register` | |
*/ | |
function wpse45134_catch_register() | |
{ | |
wp_redirect( home_url( '/register' ) ); | |
exit(); // always call `exit()` after `wp_redirect` | |
} | |
add_action( 'login_form_lostpassword', 'wpse45134_filter_option' ); | |
add_action( 'login_form_retrievepassword', 'wpse45134_filter_option' ); | |
/** | |
* Simple wrapper around a call to add_filter to make sure we only | |
* filter an option on the login reset password page. | |
*/ | |
function wpse45134_filter_option() | |
{ | |
// use __return_zero because pre_option_{$opt} checks | |
// against `false` | |
add_filter( 'pre_option_users_can_register', '__return_zero' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obat herbal QNC JELLY GAMAT obat radang empedu alami dibuat dari bahan alami yaitu teripang gamat laut sejenis hewan laut yang sudah banyak diteliti oleh para pakar kesehatan bahwa hewan ini mampu mempunyai banyak khasiat sebagai obat penyembuh berbagai macam penyakit dan ditambah dengan ekstrak buah dan sayuran yang dibutuhkan bagi kesehatan tubuh.