The API provides functionality that mirrors the shortcodes.  The shortcodes are essentially wrappers for the API.  Currently, there are two functions: one to display forms, and the other to display paginated submission data.

  • fm_doFormBySlug($formSlug) – takes a single parameter, a string containing the slug of a form.  Returns the appropriate HTML for the form state, which may be displaying the form or the acknowledgment, and processes the submitted form data.
  • fm_doDataListBySlug($formSlug, $template, $orderBy, $ord, $dataPerPage) – shows a paginated list of submission data.
    • $formSlug – a string containing the slug of a form
    • $template – can be either ’email’, ‘summary’, or the name of a template in the /templates directory, minus the “.php”.  If ’email’ or ‘summary’ are given, then the appropriate template for the form specified by $formSlug will be used.  Otherwise, this argument is assumed to correspond to a template file name.
    • $orderBy (optional) – can be the nickname of a form element, or one of ‘timstamp’, ‘user’, and ‘user_ip’.  Default is ‘timestamp’.  This will sort the results by the specified form item / submission attribute.
    • $ord (optional) – either ‘DESC’ or ‘ASC’, to choose descending or ascending order of sort. Default is ‘DESC’.
    • $dataPerPage(optional) – The number of submissions to show per page.  Default is 30.