[Resolved] Accessing Custom Post Type Data using PHP Session Array
This support ticket is created 5 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Hi, I am trying to create a wishlist-style function using PHP sessions and the Toolset plugin. Here is the function in essence:
- User clicks a link ("Add to Wishlist") on page and is directed to a Wishlist page
- The URL carries an id, which is stored in a PHP session array
- PHP foreach function cycles round session array, and accesses the corresponding custom post type created using Toolset
- Data from the custom post type is outputted on the page i.e. post title, image, description etc.
So far I have been able to get the ids into the PHP session array, but am struggling to access the custom post type data - can this be done?
You can see a starting page here: hidden link
Password: futuresysceep
When you click any of the "Add to Wishlist" links it takes you to the wishlist page, and the session array is outputted for feedback purposes.
Hi Waqar, thank you for coming back to me. Very happy to hear this can be achieved!
Could you guide me further on how to access the custom post type data using a post id? I believe I need to use the numeric ID from the item attribute, but not sure how to access the data itself?