Reuven.g
Forum Replies Created
-
Forum: Networking WordPress
In reply to: Adding check box to the new user registrationHello Ravikas,
Are you looking to modify the login or the registration page?
What is the type of field you want to add?
Do you want to save one of the built in WordPress fields, like
first name, or last name, what field do you want to save?I created roles on one site similar to “site1” “site2” and “both”.
I made a small plugin and I use it onuser_register
action, to update the meta table.
I use theupdate_user_meta' function and update the field of the sheared
prefix_usermetatable to add a field of
prefix2_capabilitieswith
meta_value`of the $_POST[‘role’].
this gives the user of site2 the ability to be updated by site1.
that way both sites are updated simultaneously.Thank you @mika
Yes I am looking to make both sites only accessible for registered users and block access from users without the right roles.
I do plan to create some custom roles for each site with different privileges.
The problem is when a user is trying to view the site not having the right privileges to view it I get the redirect loop.From the activation of the plugin I see it is not giving me options to set different privileges for different users on the same site,
It is working only if it is Network activated.
If I activate it per site the Settings -> Privacy menu not appearing.I have made a different installation of the site and share the users and usersmeta tables.
I changed the DB manually to comply with regular WP installation.
ex.define('CUSTOM_USER_TABLE', 'pref_users'); define('CUSTOM_USER_META_TABLE', 'pref_usermeta');
One of them is on a subdomain so I have a similar behavior to the multiseuit.
And I use theupdate_user_meta()
function with theuser_register
action
to set for the newly created user a role on the second blog.
I know it’s a workaround but it is working the way I need it now.I am looking for the right action of filter to use
update_user_meta()
when updating a user in the user-edit.php page.
So I will be able to set the users for both installations.Forum: Hacks
In reply to: Disable the javascript function wp_attempt_focus() in wp-loginThank you @robbert,
I had to change the hackish fix to make it work for me.
function kill_wp_attempt_focus_replace($html) {
return preg_replace(‘/function wp_attempt_focus/’,’function wp_attempt_focus(){} function wp_attempt_focus_killed’,$html);
}
I changed the preg_replace.Forum: Networking WordPress
In reply to: Adding check box to the new user registrationMy mistake was that this hook ‘signup_extra_fields’ is intended for the front-end page registration form, and I was looking to change the user-new.php registration.
I wasn’t even checking the front-end,
Thank you, the hooks in this post are intended to be used in the regular installation of WordPress, I use a multisite so they don’t
do any good for me.
After your suggestion I reread that post, and checked the front-end page registration, found the checkbox there.
For the new user form in the back-end I found the hookuser_new_form
and it work good just changing the hook to:function japanese_toggle_callback($errors) { $html = '<label for="send_japanese" id="jap_label"><input type="checkbox" id="send_japanese" name="send_japanese" value="1" ' . checked(1, get_option('send_japanese'), false) . '/>'; $html .= ' Add Japanese user</label>'; echo $html; } add_action('user_new_form', 'japanese_toggle_callback', 10, 1);
I did’t do any validation or registration of the value in the checkbox because I only need to check if it is submitted.
Forum: Networking WordPress
In reply to: Adding check box to the new user registrationIs there a way to move this topic to: Plugins and Hacks?
Forum: Networking WordPress
In reply to: Changing the URL in Network Admin – WWW addedchange the DB table of the wp_options, wp_1_options, wp_2_options..
(wp is a prefix) change the siteurl and home option value to the https://www.myedmradio.com, and go to the posts tables and change the guid of every post and any post_content that might lead to https://myedmradio.com.Forum: Networking WordPress
In reply to: multisite sites not working rightIt can also be a database conflict.
Forum: Networking WordPress
In reply to: multisite sites not working rightIt looks like a redirect problrm.
What kind of multisite you are using?
From the url I see a sub-directory setting.
If it was an existing site that you are attempting to move on to a multisite installation, Then when you were updating to a multisite
you told to use the sub-domain type.
If that so the code that was supplied to you by the WordPress network setting containsdefine('SUBDOMAIN_INSTALL', true);
you can try to change it to false.
And you can also attempt to re-install WP with different table prefix,
if you want to use sub-directories and install multisite on the clean version of the tables.
Then migrate the database tables with the data of your site.