Strange “lea” prefix on wp-json

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.

Is there a way I can fetch the WordPress Developer Code References with an API?

It seems to be accessible from: https://developer.wordpress.org/wp-json/wp/v2/wp-parser-class https://developer.wordpress.org/wp-json/wp/v2/wp-parser-method https://developer.wordpress.org/wp-json/wp/v2/wp-parser-hook https://developer.wordpress.org/wp-json/wp/v2/wp-parser-function and search with e.g. https://developer.wordpress.org/wp-json/wp/v2/wp-parser-function?search=get_post_embed but it’s probably best to generate your own with the WP Parser here: https://github.com/WordPress/phpdoc-parser This will create custom post types for wp-parser-hook wp-parser-function wp-parser-class wp-parser-method and related post meta (to e.g. store function input arguments, line numbers, class type, hook … Read more

Getting a GET error in console – 404 not found for wp-json

The URL you’re using is not the URL that you’ve registered. This code: register_rest_route( ‘news’, ‘/news’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘custom_api_get_news_callback’ )); Registers this URL: http://localhost:8888/una/wp-json/news/news But you’re sending requests to http://localhost:8888/una/wp-json/news/all-posts Nowhere in your code have you defined an all-posts endpoint. You either need to change /news in register_rest_route() to /all-posts, or … Read more

JSON-LD: creating an AggregateOffer from many shortcode

If you have full control over the system, it would be best to get all of the data by some other means. If you must concatenate the shortcodes, you can parse the content to get the shortcodes with get_shortcode_regex(). You can save all the matches, and their attributes, and remove them from the content. Then, … Read more

ACF save json to custom directory not working, default acf-json used instead

the two filters don’t have the same output. you can test that add_filter(‘acf/json_directory’, function ($path) { return get_template_directory() . ‘/config/acf-json’; }); add_filter(‘acf/settings/save_json’, function ($path) { return apply_filters(“acf/json_directory”, NULL); }); add_filter(‘acf/settings/load_json’, function ($paths) { return [ apply_filters(“acf/json_directory”, NULL) ]; });

Why WordPress not using JSON_UNESCAPED_UNICODE by default?

Because until relatively recently WordPress supported PHP 5.2+, but that constant was only added in PHP 5.4. Given that wp_json_encode is meant to encapsulate and account for the differing behaviour of json_encode across multiple PHP versions, it doesn’t make sense to deliberatly change its behaviour for PHP 5.4+ Now that WordPress has raised its minimum … Read more

Custom WP API endpoint NULL body data

I have solved the issue. It was unrelated to json / javascript / api. It was a simple issue of tmp folder ownership. Since there were no errors spewing out by the php managing the request, I never noticed a PHP NOTICE saying to check permissions in temp folder as php was unable to upload … Read more