Support » Plugin: MailPoet - emails and newsletters in WordPress » Echo list of forms with php

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author MailPoet

    (@wysija)

    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 2 years, 7 months ago by MailPoet.

    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 2 years, 7 months ago by mrcasual.
    • This reply was modified 2 years, 7 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.