Extending the get_field function in Advanced Custom Fields to have a default and fallback option

This function will extend the default get_field function within Advanced Custom Fields to also allow you to:

  • pass in a default value in case none are found
  • fall back to site options (if one exists)
  • pass in the ID of the post to get the field from and then apply the previous actions