We're Moving to a New Support Platform – Starting June 1st!
We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.
You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.
While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.
We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.
Thanks for your continued support and trust – we’re excited to bring you an even better support experience!
Hi,
I've been trying all day and can't get this to work so need some help.
Following the guidance at https://wpamelia.com/wp-hooks-notifications/ I've created a custom hook but it doesn't seem to be able to call any data from $data
function amelia_customerisvip($data) {
$appt_id = $data['appointment_id'];
return 'VIP Status:'.$appt_id;
}
// Add filter to handle dynamic placeholder
add_filter('amelia_dynamic_placeholder_customerisVIP', 'amelia_customerisvip', 10, 1);
Ultimately I want to be able to do manipulate the appointment ID but at this stage I can't get it to pull out any data from $data. I can, by testing with Uncanny Automator's hooks function, that $data returns all of these options but they all seem to be empty:
Ideally, rather than Appointment ID, I'd like the customer ID if that's possible?
What am I doing wrong?
Hello Tom,
It seems like you're on the right track, but the issue may lie in the timing of when the $data is being populated or passed to your custom hook. The placeholder data you’re trying to use may not be available at the time you're trying to access it. Let's walk through a few things you can try:
Make Sure Data Is Available:
The placeholders you’re trying to access, like appointment_id, may not be populated at the moment the hook runs, depending on how and when the notification is triggered. Ensure that the data you're trying to manipulate is available at the point of execution.
Check Hook Context:
Confirm that the hook is triggered in the correct context, where the $data array contains the values you're expecting. It’s possible that the data isn't available when your hook is firing, or it may need to be initialized first.
Customer ID:
If you're looking for the customer ID instead of the appointment ID, you can check the $data array for keys related to the customer. Typically, customer_id should be available. You can try this in your function to see if it's populated correctly:
This will check if the customer_id is in the $data array and output it accordingly.
Using the Right Hook:
Ensure you are using the correct hook for your desired outcome. You are using amelia_dynamic_placeholder_customerisVIP, which might not always pass the expected data. You might need a different hook depending on what you need to do with the data.
If you still cannot access the customer_id or other expected data from $data, you can also try logging the $data array at runtime to see exactly what’s being passed:
This will help you debug the structure of $data and confirm what’s available to you.
Let me know if that helps or if you need further assistance!
Kind Regards,
Uros Jovanovic
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables