Viewing 3 replies - 1 through 3 (of 3 total)
  • Re,

    Please clarify what it is exactly that you would like to display (e.g., form IDs, titles, etc.)

    MailPoet Team.

    • This reply was modified 7 years, 10 months ago by Wysija.
    Thread Starter wpwebbiepro

    (@webbiepro777)

    I’d like to know both. Want to create a select field with the different forms as options and the output should be the form ID. My clients can then select the right form name and the ID is inserted inside a form shortcode which is echoed on the page.

    Re,

    This should work:

    
    $forms = \MailPoet\Models\Form::findMany();
    foreach($forms as $form) {
      // $form->id
      // $form->name
    }
    

    MRC

    • This reply was modified 7 years, 10 months ago by mrcasual.
    • This reply was modified 7 years, 10 months ago by mrcasual.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Echo list of forms with php’ is closed to new replies.