Opened 14 years ago
Closed 10 years ago
#15424 closed defect (bug) (duplicate)
Refresh post count when a post is deleted
Reported by: | chouxpastry2002 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Options, Meta APIs | Keywords: | has-patch close |
Focuses: | multisite | Cc: |
Description
Hi Guys,
I am reporting a bug in the system. I have various users in WPMU. They have their posts and i am tracking their no of posts.
Now if i delete a post from users account post count isnt getting updated. It remains at what it was previously.
eg. If a user has 4 posts in his account and he deleted his one post still the "post_count" field in "wp_options" table remains 4 only. Its not getting updated to 3.
Is there any patch for this ??
Awaiting eagerly for response.
Samir
Attachments (1)
Change History (19)
#2
@
14 years ago
Site and user counts are via wp-cron. post_count is handled in the function update_posts_count(), which is indeed attached to the right hook:
./wp-includes/ms-default-filters.php:37:add_action( 'publish_post', 'update_posts_count' );
#3
@
14 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
Let me rephrase, it only gets updated when a post is published. So on post deletion, it will not be updated.
You can attach it to a hook on post deletion if you need that.
#5
@
14 years ago
- Milestone set to 3.1
- Resolution wontfix deleted
- Status changed from closed to reopened
#6
@
14 years ago
I don't know. But it's from MU. I'm not inclined to change it further.
Ideally the post counts should be stored in persistent cache anyway, not the options table.
#9
@
13 years ago
- Summary changed from A bug in WordPress operation to Refresh post count when a post is deleted
#11
follow-up:
↓ 13
@
11 years ago
- Version changed from trunk to 3.1
Version number indicates when the bug was initially introduced/reported.
#13
in reply to:
↑ 11
;
follow-up:
↓ 14
@
11 years ago
Replying to helen:
Version number indicates when the bug was initially introduced/reported.
I know this is the wrong place to mention this, but sometimes when I load a ticket it sets the version to trunk instead of the actual version. Is this a know issue?
#14
in reply to:
↑ 13
;
follow-up:
↓ 15
@
11 years ago
Replying to avryl:
Replying to helen:
Version number indicates when the bug was initially introduced/reported.
I know this is the wrong place to mention this, but sometimes when I load a ticket it sets the version to trunk instead of the actual version. Is this a know issue?
Maybe make a ticket on Meta Trac if it's a recurring problem.
#15
in reply to:
↑ 14
@
11 years ago
Replying to DrewAPicture:
Replying to avryl:
Replying to helen:
Version number indicates when the bug was initially introduced/reported.
I know this is the wrong place to mention this, but sometimes when I load a ticket it sets the version to trunk instead of the actual version. Is this a know issue?
Maybe make a ticket on Meta Trac if it's a recurring problem.
Thanks!
So you're using WP 3.1-alpha?
I think post counts are updated via wp-cron, so it might not happen instantly.