admin管理员组

文章数量:1192929

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?

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?

Share Improve this question edited Aug 3, 2022 at 22:21 Volomike asked Aug 3, 2022 at 22:12 VolomikeVolomike 1,8652 gold badges18 silver badges20 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

本文标签: Strange quotleaquot prefix on wpjson