Hi, I need to retrive the Form Title by ID. Tried the get_forms_by_id()
function but didn't work. RGFormsModel::get_forms()
worked when looped but I have the form ID and just need the Title.
Thanks
Hi, I need to retrive the Form Title by ID. Tried the get_forms_by_id()
function but didn't work. RGFormsModel::get_forms()
worked when looped but I have the form ID and just need the Title.
Thanks
Please show us the code you're using and how and where you're using it and we should be able to help you. What are you trying to do exactly?
Hi Chris
I have the ID of the form saved as $form_id in my Taxonomy meta. I would now like to display the associated Form title to the taxonomy only in my Customs Columns.
I just need the Form title not the whole form etc. I hope this is well enough explained.
In my opinion there has to be some function to get the form title / description etc. by ID without printing the whole form, or am I wrong?
Thanks and regards,
Marcel
If you have the form ID, you can get the title like this:
[php]
function marcel_get_the_form_title($form_id) {
$forminfo = RGFormsModel::get_form($form_id);
$form_title = $forminfo['title'];
return $form_title;
}
Hi Chris,
Thanks for your reply! At first I got a error message, as the value im trying to get is not an Array. I changed the code as follows and now it works!
function marcel_get_the_form_title($form_id) {
$forminfo = RGFormsModel::get_form($form_id);
$form_title = $forminfo->title;
return $form_title;
}
Thanks and regards, Marcel
Glad you made that work. Thank you for the updated code.