I have tried looking for a simple answer and if there is already a post that I can be sent to, please by all means send me a link.
The background to this may not be needed but I feel that providing it will help to clarify the answer I am looking for.
Coming from Drupal I find Wordpress methods both similar and very different, with Drupal I would tell it the name of the page and the callback function to display what I want it to display, I am trying to develop with wordpress but because I am so used to Drupal terminology and methods I am having a difficult time trying to work through sometimes even the simplest of things.
basically what I want to do is to display the result of a function on the users profile page.
the background is this.
A user has a calendar - this is shown month by month, so when a users profile page is opened up the calendar is supposed to show custom post type (an Event) on the date in question.
I have the custom post types created, I have the calendar created, what I need to do is this.
When the page loads I want to grab all the post types of 'Event' created by that whomsoever is being viewed. normally I would have grabbed the user by the url, because that is how I would I would know whose page is being viewed. but because I am using wordpress I am given to understand that there are other ways of getting the user data.
The question I suppose is this.
When displaying custom data on a users profile page I need to create an action (or a shortcode) that will inject the calendar into the page, How do I know which profile is being displayed and how can I grab data from a users object (if WP uses a $user object) so that I can pass this as an argument to my code so that I am getting the correct post types?
I also need to clarify this, I am NOT displaying the full custom post types, I just need to get them from the database so that I can then loop through them, discover which of them have a date that matches the month being viewed and display the title of each one.
I can read the data from the database, I can inject this into the calendar, I will be able to (eventually) display this on the profile page (via an action, filter or shortcode) but at the moment I have no idea which user profile is currently being viewed, and how can I access the data of that given user.
Thank you in advance for any help given.