bestprogrammerintheworld

less info
145 reputation
11
bio website wibergsweb.se
location Sweden
age 40
visits member for 6 months
seen Apr 16 at 14:45

I'm developing both code and my own company Wibergs Web. I live in Skövde, Sweden - and I'm enjoying life even though I haven't seen any polar bears here recently ;-)


Feb
20
asked Is there anything special I have to think of when setting post_date_gmt when inserting a new post?
Feb
19
asked get_edit_post_link returning incorrect post id - why?
Feb
9
accepted Add a custom post when inserting a new user in Wordpress?
Feb
9
comment Add a custom post when inserting a new user in Wordpress?
Thanks for pointing me in the right direction! :-) I think I will figure it out now! :-)
Feb
8
comment Add a custom post when inserting a new user in Wordpress?
I want to do the checking of the users email before, but the ideal would be insert/create the cpt after the user is succesfully created. If the email already exist, I don't want to create a user, but I want to create a CPT for the user with that email.
Feb
8
asked Add a custom post when inserting a new user in Wordpress?
Jan
28
accepted Handle registrations in WordPress when user doesn't have any email?
Jan
28
comment Handle registrations in WordPress when user doesn't have any email?
Ok, Thanks a LOT! :-)
Jan
28
comment Handle registrations in WordPress when user doesn't have any email?
So if I understand you correctly, this is essentially what you're saying: Create a CPT registration. Make relations to courses through the registration CPT instead of the actual user. Create a relation between the registration CPT and the user by setting the post_author to the user. Have I understood you correctly?
Jan
28
comment Handle registrations in WordPress when user doesn't have any email?
Hi and thanks for your answer! I agree that users should be unique. That's why I have to manage to make the system more "sane". I've read your answer several times and it makes a whole lot of sense, but I don't really understand everything. "Now you can connect users to registration using post_author field," How do you mean? (The courses are currently custom post types and they have same custom meta fields like price, day, time and so on. I store which courses are relevant to each user in the user_meta - with something like course_1243, course_1257 where 1243 and 1257 is the id of CPT course)
Jan
28
comment Handle registrations in WordPress when user doesn't have any email?
Yes, good point about the the mental capacity :-) I don't mean the children should be able to login (cause I can't say that a 4-year can't (or is not allowed to by his/her parent)). yes, the actual issue probably is defining whom should be a user. It's not obvious though (or is it?) I have code which sets relations between users and payments/courses etc. A thought would be to create a user-role (named children) that is related to a specific user (parent). I really don't know if that is achievable and how to do that. But still there is a problem that each user should have an unique mailadress.
Jan
28
revised Handle registrations in WordPress when user doesn't have any email?
added 512 characters in body
Jan
28
comment Handle registrations in WordPress when user doesn't have any email?
Ok. I will try to clarify: It's about registrering different dance-courses. The dance academy wants to keep track of how many pupils (users) there are at any course and wants to keep to track of user has payed the course or not. Sometime the user can be set as reserve and sometimes not. To complicate it further it's not always this relationship between parent/child. Sometimes- let's say an 18-year old wants to register at 3 dance-courses and the user is "child" (or could at least handle the registration him/herself). Does that make sense?
Jan
28
asked Handle registrations in WordPress when user doesn't have any email?
Jan
28
awarded  Autobiographer
Jan
28
comment How to check if a user is in a specific role?
I know this post is answered a long time ago but if someone happens to get here... look at the documentation once more for current_user_can() -> "Do not pass a role name to current_user_can(), as this is not guaranteed to work correctly (see #22624). Instead, you may wish to try the check user role function put together by AppThemes." (codex.wordpress.org/Function_Reference/current_user_can)
Jan
15
comment Is it better to use filter for the_content in archive pages?
Thank you for your comments! I think those would qualify for an answer :-)
Jan
15
asked Is it better to use filter for the_content in archive pages?
Dec
10
revised Is it possible to pass variables from add_user_page?
added 1227 characters in body
Dec
10
comment Is it possible to pass variables from add_user_page?
I agree that oop is the best way to do programming, but I just meant that such a simple task should have been easier to implement :-)