Home

This site demonstrates how to use WordPress for CRUD.

Example 1: Websites

  • Uses Ninja Forms to display all entries
  • Uses Advanced Forms Pro for adding/editing an entry
    • Note: I had to use a GeneratePress Elements hook (generate_after_content) to load the shortcode to edit an entry
  • Uses custom shortcode in Ninja Form to display delete link (see code below)

Example 2: Movies

  • Uses Ninja Forms to display all entries
  • Uses Frontend Admin for adding/editing an entry
  • Uses custom shortcode in Ninja Form to display delete link (see code below)

Adavanced Forms Pro vs Frontend Admin

Thoughts on using ACF Forms for editing/adding new entries:

  1. All ACF fields are automatically added
  2. Only one shortcode is needed per ACF form
  3. Resource: https://advancedforms.github.io/faq

Thoughts on using Frontend Admin for editing/adding new entries:

  1. You need to add each ACF field to the form
  2. More control over the layout of form fields
  3. You have to create a separate form for adding and editing (redundant work)

Why I used Ninja Forms to display entries

  • I can easily add custom columns (such as Delete links or changing the link to edit an entry)
  • Requires Ninja Forms Pro for advanced shortcode parameters
  • Only con: doesn’t display total rows if there’s only one page of entries

Why I didn’t use other table plugins to display entries

  • WPDataTables
    • Not easy to add custom columns (such as Delete links)
    • I did like the query builder, allowing you to see the actual SQL query
  • Posts Table Pro
    • Not easy to add custom columns (such as Delete links) – it requires you to add it as a custom field at the post level

My Custom Shortcode