I have made page with function wp_insert_post(),

$page_id = wp_insert_post(array(
                'post_title' => 'Name',
                'post_status' => 'publish',
                'post_author' => $current_user->ID,
                'post_type' => 'page',
                'post_content' => '123'

And then update the permalink of that page:

                "post_name" => 'name',
                "ID" => $page_id,

As a result after updating that page from Gutenberg :

Updating failed. The response is not a valid JSON response.

Why this happend?

Your Answer

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

Browse other questions tagged or ask your own question.