WordPress menus – automatically generate

Use the WP database (via proper methods) to store a ‘is this the first run’ flag?

Then just conditionally execute.

  1. check for flag in wp db
  2. if exist do nothing
  3. if not exist
  4. create me my menus dag nammit
  5. remember to set flag for next round so its only done once

Something like that?

If you need to regenerate then just flip the flag from within the code that decides if the menus need regenerating.