PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Get the Form title by ID

  1. 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.


    Posted 9 years ago on Sunday November 11, 2012 | Permalink
  2. 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?

    Posted 9 years ago on Monday November 12, 2012 | Permalink
  3. 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,

    Posted 9 years ago on Monday November 12, 2012 | Permalink
  4. If you have the form ID, you can get the title like this:

    function marcel_get_the_form_title($form_id) {
      $forminfo = RGFormsModel::get_form($form_id);
      $form_title = $forminfo['title'];
      return $form_title;
    Posted 9 years ago on Tuesday November 13, 2012 | Permalink
  5. 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

    Posted 9 years ago on Wednesday November 14, 2012 | Permalink
  6. Glad you made that work. Thank you for the updated code.

    Posted 9 years ago on Saturday November 17, 2012 | Permalink

This topic has been resolved and has been closed to new replies.