Code Snippet (Wordpress/php/Tutor LMS Pro)
There is a website on WordPress. A Tutor LMS plugin has been added there, which is used for hosting courses and, consequently, teaching them.
I need:
When a user is created with a certain label, tag, or can use the "website" field as a label, then depending on the tag, the code should enroll this user as a student in the "Tutor Lms - Enrollment" course.
So, the trigger here is the creation of a user.
As far as I understand, it's better to do this in a plugin like Code Snippet, but I'm not a programmer, I can't do it.
Chatgpt gave me examples like this, but they don't work or maybe I'm doing something wrong:
"
function auto_enroll_subscriber_to_course($user_id) {
$user = get_userdata($user_id);
// Check if the user has the Subscriber role
if (in_array('subscriber', $user->roles)) {
$course_id = 123; // ID of the course to enroll the user in
tutils()->do_enroll($user_id, $course_id);
}
}
add_action('user_register', 'auto_enroll_subscriber_to_course');
"
We can set up a meeting to discuss this further.
Applications 1
-
1602 31 1 Good day, I have been working in web programming for over 6 years. I work with rest api, frameworks, and cms such as laravel, yii2, wp, opencart, etc. Ready to complete the task.
-
4926 88 0 Good day, Max
I have experience working with Turbo SMS
Ready to complete within 2-3 hours
Write in PM, I will start immediately
-
1322 13 2 Hello, I am interested in the project, I would be happy to cooperate, I would like to discuss everything in private, if you don't mind, write in private, thank you)
-
Дак а вы саму роль создали что бы проверять её наличие у пользователя ?
В целом то я работаю с Tutor LMS pro там вроде как не проблема зачислять на курсы в ручную, но как я понял вы хотите авто зачисление на курс при выборе определённой роли пользователю когда создаёшь аккаунт либо что бы при регистрации аккаунта давало сразу эту роль и зачисляло на нужные курсы, я вижу что GPT вам посоветовал авто зачисление если есть определённая роль у пользователя ( не знаю на сколько это рабочий код ) Но он точно не будет работать если этой роли нет, её нужно тоже создать через функцию -
Доброго дня, прочитайте, мне лично непонятно - Мне нужно:
Когда создаётся пользователь, с какой-то пометкой, тегом, может пометку использовать поле "веб-сайт", то в зависимости от тега, код должен в "Tutor Lms - Enrollment" занести этого пользователя как студента на курс. -
Current freelance projects in the category PHP
Development of a WordPress website
23 USD
We are looking for a contractor to develop a custom website on WordPress for a jewelry store. The first stage will be a consultation. Content Management Systems, PHP ∙ 7 hours 37 minutes back ∙ 40 proposals |
The WooCommerce cart (WordPress) is broken — it does not add products and the cart page does not open.On the website of the online store https://www.dobryi-gospodar.com/ (WordPress + WooCommerce), the checkout function has completely stopped working. When clicking the "Add to cart" button (both in the product card and in the catalog), a long loading process begins (the indicator… Content Management Systems, PHP ∙ 9 hours 25 minutes back ∙ 47 proposals |
Product search function by imageIt is necessary to develop and integrate a product search function by image on the website.What needs to be implementedA "Search by Photo" button on the website.Image upload by the user: JPG.Search for visually similar products in the catalog.Display results in the form of… PHP, Web Programming ∙ 16 hours 51 minutes back ∙ 40 proposals |
Parser expireddomains.net
113 USD
A parser is needed for expireddomains.net. You need to log in to the site first; the problem is that it blocks the IP when trying to parse data. You need to parse thematic domains based on a list of keywords. If you are not confident in your abilities, please do not write. PHP, Web Programming ∙ 2 days 15 hours back ∙ 50 proposals |
Integration of payment service with Sales Force
70 USD
There is a payment system widget on the site that needs to be integrated with Salesforce so that all required parameters are visible on the Salesforce side. It needs to be done in such a way that all payments and subscriptions are controlled through Salesforce. PHP, Web Programming ∙ 2 days 19 hours back ∙ 41 proposals |