[wp-trac] [WordPress Trac] #64921: REST API POST /wp/v2/posts: Undefined property stdClass::$id (line 766)

WordPress Trac noreply at wordpress.org
Tue Mar 24 14:52:12 UTC 2026


#64921: REST API POST /wp/v2/posts: Undefined property stdClass::$id (line 766)
-------------------------------------+--------------------------
 Reporter:  swissspaceboy            |       Owner:  westonruter
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  7.1
Component:  General                  |     Version:  4.7
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  rest-api
-------------------------------------+--------------------------

Comment (by nikunj8866):

 == Reproduction Report ==

 === Description ===
 ❌ This report validates that the reported issue can not be reproduced.

 === Environment ===
 - WordPress: 6.9.4
 - PHP: 8.3.29
 - Server: Apache/2.4.43 (Win32) mod_fcgid/2.3.9a
 - Database: mysqli (Server: 10.6.23-MariaDB / Client: mysqlnd 8.3.29)
 - Browser: Chrome 146.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.4
 - MU Plugins: None activated
 - Plugins:
   * Easy Table of Contents 2.0.82.1
   * Test Reports 1.2.1

 === Steps to Reproduce ===
 1. Enabled debug logging in wp-config.php:
    {{{
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    }}}
 2. Installed and activated Easy Table of Contents 2.0.82.1.
 4. Enabled Table of Contents for Posts under
    Settings > Table of Contents.
 5. Created an Application Password via
    Users > Profile > Application Passwords.
 6. Sent the following POST request via Postman:
    - URL: http://yoursite.com/wp-json/wp/v2/posts
    - Method: POST
    - Authorization: Basic Auth (username + application password)
    - Body (raw JSON):
    {{{
    {
      "title": "Test Post",
      "content": "<p>Hello</p>",
      "status": "draft"
    }
    }}}
 7. Checked wp-content/debug.log for PHP warnings after the request.

 === Actual Results ===
 ❌ Error condition does not occur (not reproduced).
 - Post was created successfully (HTTP 201 response received in Postman).
 - No PHP warnings related to stdClass::$id or stdClass::$post_parent
   were found in wp-content/debug.log.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64921#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list