Gravity Forms & Rest Api Fix

I looked for a fix to this problem but came up completely empty.

Here’s the scenario you are using Gravity Forms on your site. You are rendering your posts with the Rest API. You have a gravity form getting displayed in a post using a short code or the gutenberg plugin.

When you submit a form you get a 401 error that says “Sorry, you are not allowed to edit this post.” With a code of rest_cannot_edit.

Every tip, article, github issue, stack overflow question led me nowhere. Then I compared the form our client was seeing on their posts to what a healthy, working gravity form looks like.

Heres what a bad form looks like

Heres what a good form looks like

The problem area is in the action. When a post is pulled through the Rest API with a Gravity Form in it – the action on the form gets overridden. Unfortunately with Gravity Forms I didn’t see a hook where this behavior could be overridden.

So I came up with a little hack with a couple lines of javascript.

We are using vue.js on the project where I wrote this fix. So conveniently all I had to do what grab the slug of the current post from state. Depending on your use case you might need to figure out a different way to grab the slug. You’ll also want to make sure that the DOM has been completely loaded before running the function. Lastly make sure you set the ajax option on the shortcode in the post to false.

Here is a really neutered version of the code where we are using this.

CrossfitSBY Videography

I got to do some video stories for CrossfitSBY. We had two main objectives.

  • Fill up their 9am class (which is a perfect entry point for stay at home moms to join their membership).
  • Show off some of the abilities and improvements that comes along with committing to Crossfit for an extended period of time.

Most of the cinematic shots were captured using a gimbal and a few were hand held. We wanted emphasize their kid friendly environment. I can attest to that and you can see the kids running around in some of the shots. It truly is a kid friendly environment.

I’m thrilled to be able to announce these videos and I’m super happy with the way they come out.