[wp-trac] [WordPress Trac] #54462: The `post_count` option value isn't incremented when the "Hello world!" post is inserted during blog creation

WordPress Trac noreply at wordpress.org
Wed Nov 17 23:37:13 UTC 2021


#54462: The `post_count` option value isn't incremented when the "Hello world!"
post is inserted during blog creation
------------------------------------+------------------------
 Reporter:  henry.wright            |       Owner:  audrasjb
     Type:  defect (bug)            |      Status:  reopened
 Priority:  normal                  |   Milestone:  5.9
Component:  Posts, Post Types       |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  multisite
------------------------------------+------------------------
Changes (by audrasjb):

 * keywords:  has-patch commit => has-patch dev-feedback


Comment:

 That's a fair point. I'm still checking everywhere but yes it looks like
 the option wasn't created before on single-site installs.

 In that case, I'm not sure `update_posts_count` is better than
 `update_option( 'post_count', 1 );`.

 It looks like `wp_install_defaults` can not be overridden by any hook, so
 I'd say that updating the option directly is more straightforward. Any
 thoughts @dlh?

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


More information about the wp-trac mailing list