Tag Info

New answers tagged

0

You're not handling the names the same way as the other fields: //// VERIFIES CREDENTIALS $username = isset($_POST['username']) ? trim($_POST['username']) : ''; $first_name = isset($fields['user_first_name']) ? sanitize_text_field(trim($fields['user_first_name'])) : ''; $last_name = isset($fields['user_last_name']) ? ...


0

Your best bet would be to hook register_form. It will require parsing the html and removing elements manually, something like this should point you in the right direction. function removeFormElements(){ $form = ob_get_contents(); //manipulate $form to remove the elements with something like either regex or the php DOM parser ob_get_clean() ...


0

I used the below code in the end. Hope someone finds this useful. /* Display only user-uploaded files to each user in Media Library for file upload form*/ function user_restrict_media_library( $wp_query_obj ) { global $current_user, $pagenow; if( !is_a( $current_user, 'WP_User') ) return; if( 'admin-ajax.php' != $pagenow || ...


2

Regarding the update part in your question: I think the problem here is that you're missing the number of accepted arguments in your add_action() setup. If you check out the Codex, the usage is: add_action( $hook, $function_to_add, $priority, $accepted_args ); where by default $priority = 10 and $accepted_args = 1. So your code snippet should be like: ...


2

@Nishant Kumar gave the perfect and should-be-accepted answer to this question. However there is a glitch after the Wordpress 4.0 version released. From codex- Note: Since 4.0, these properties are private, see [28511]. registration_errors filter here requires a little modification. //Remove error for username, only show error for email only. ...


0

You might simply want to go to Settings > General. Here you can select the standard role a user gets, once he registers.


0

I found a good answer and slightly modified it on a related question . It uses htaccess, and redirects any requests to wp-login.php?action=register. # BLOCK SPAM REGISTRATION REQUESTS (wp-login.php?action=register) <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{THE_REQUEST} ^.*(wp-login.php\?action=register).* [NC] RewriteRule ^(.*)$ ...



Top 50 recent answers are included