0

I've been using wp-json steadily for a couple years now on a headless CMS project and had no problem getting valid JSON back. I set the website to auto-update all themes, plugins, and WP version. I also added some extra plugins to enhance the wp-json:

  • WP Rest Api V2 Multiple PostTypes
  • REST API Helper
  • Custom Post Types

Today, we started getting invalid JSON back with an "lea" prefix string on the beginning of the JSON for some unknown reason, creating invalid JSON. When I remove this "lea" prefix at the beginning of the JSON, the website works normal again.

Where might I look to see where this "lea" is being added?

1 Answer 1

1

I found it. There's a bug in the TotalPress.org Custom Post Types plugin in the file:

wp-content/plugins/custom-post-types/custom-post-types.php

At the top of the file, you will see the mistake:

lea<?php

When I remove the lea, the problem goes away. I'm contacting the plugin developer to let them know. Plugin version was 3.0.12.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.