Triggering PHP Code while passing Through a Variable
-
Hello,
Lately I have been working on developing an LMS site using a custom theme and custom post types. I have two custom post types set up, one for courses, and one for lessons that will go inside each course. What I am currently trying to setup is a way to append lesson post type ids to a user’s meta data after that lesson is completed. I have a javascript function set up so when a user watches a lesson video, that lesson post type id is saved in a variable, and that seems to be working well. The only problem is I need to use PHP to add that variable to the user’s meta data.
I was reading that ajax would help with a problem similar to this, but I am not entirely sure how to implement ajax for this. I have my PHP set up in a different root directory file called ‘php-file-test.php’ and all I need to do is trigger that code to run while also passing through the lesson post type id variable. Would you have any advice as to how to approach the problem?
Thank you for your time,
IanWP.com: Yes
Correct account: YesThe blog I need help with is: (visible only to logged in users)
-
Hi Ian,
I’m afraid this support forum is for questions related to the services provided by the hosting company WordPress.com and for websites hosted by WordPress.com only. Your question seems to be related to WordPress as in the free site engine software, WordPress.ORG.
You can post any questions related to the WordPress.org site engine to their own support forums, available here: https://wordpress.org/support/forums/
Thank you for your kind understanding!
- The topic ‘Triggering PHP Code while passing Through a Variable’ is closed to new replies.