wordpress multisite, how to keep user on subdomain throughout registration process?

What @petermolnar suggested also redirects your users to the main site if they want to register (I’ve tested this but feel free to make use of it. It’s good practice). What you need is a registration/login/edit-profile plugin for the front end: http://www.cozmoslabs.com/1341-wordpress-profile-builder-a-front-end-user-registration-login-and-edit-profile-plugin/ It’s shortcode based so all you have to do is redirect your users … Read more

WordPress Multisite allow site admin to add user without email confirmation

You will not be able to enable the checkbox for non-super-admins as the code for it shows: <?php if ( is_multisite() && is_super_admin() ) { ?> <tr> <th scope=”row”><label for=”noconfirmation”><?php _e(‘Skip Confirmation Email’) ?></label></th> <td><label for=”noconfirmation”><input type=”checkbox” name=”noconfirmation” id=”noconfirmation” value=”1″ <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( ‘Add the user without sending them a … Read more

Find out who deleted a page or post?

By default, no, WordPress doesn’t keep track of who changes post statuses (at least that I can see). you can hook into transition_post_status and log the user id. add_action( ‘transition_post_status’, ‘wwm_transition_post_status’, 10, 3 ); function wwm_transition_post_status( $new_status, $old_status, $post ) { if ( ‘trash’ == $new_status ) { $uid = get_current_user_id(); //somehow or another log … Read more

alphabetically order role drop-down selection in dashboard

Almost the same approach One Trick Pony has chosen, but I am using translated names and uasort() (to preserve the keys): add_filter( ‘editable_roles’, ‘t5_sort_editable_roles’ ); /** * Array of roles. * * @wp-hook editable_roles * @param array $roles * @return array */ function t5_sort_editable_roles( $roles ) { uasort( $roles, ‘t5_uasort_editable_roles’ ); return $roles; } /** … Read more

How to display a public profile page for registered users with custom slug?

Every registered user can have profile, they don’t need to have posts. To change WordPress author’s profile permalink, paste the following code in your functions.php: function change_author_permalink_base() { global $wp_rewrite; $wp_rewrite->author_base = “user”; } add_filter( ‘init’, ‘change_author_permalink_base’ ); After pasting the code, visit Settings->Permalink Structure under your wordpress admin, to flush the rewrite rules. This … Read more

How can 2 blogs share the same users

I think you want to install your second site on the same database but with a different table prefix, e.g. $table_prefix = “qa_”; in wp-config.php You are then able to define a custom user and/or user_meta table by adding the following lines to wp-config.php define(‘CUSTOM_USER_TABLE’, [orig_table_prefix].’my_users’); define(‘CUSTOM_USER_META_TABLE’, [orig_table_prefix].’my_usermeta’); Source: http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables I have read somewhere before … Read more

Ban a user and end their session

Use wp_logout(). It calls wp_clear_auth_cookie() and invalidates the current log-in information immediately. Sample code, not tested: add_action( ‘init’, ‘log_out_banned_user’ ); function log_out_banned_user() { if ( ! is_user_logged_in() ) return; $user = wp_get_current_user(); if ( ! get_user_option( ‘rc_banned’, $user->ID, false ) ) return; wp_logout(); wp_redirect( home_url( “https://wordpress.stackexchange.com/” ) ); exit; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)