Error counter
Author | Posts |
---|---|
November 8, 2013 at 4:57 am 9848 | |
HI, On the desktop, the counter posts gives me error. If I have created two posts and then I eliminate the two posts, the counter should again be two (Post Left: 2), but not, the counter stays at zero (Post Left: 0) and I can not create a new post (You must purchase a pack before posting). The subscription package is for one year but the elimination of the post should make up the counter, in this case is not that. Thanks, David | |
November 8, 2013 at 6:40 am 9854 | |
Hello David, Thats why “Edit” option comes! If user not happy with the post then they can edit that. Post deleting not going to increate post limit again. Cause, user already posted what they paid for! Isn’t it? If you need to edit user’s post limit you have to do that manually. Go to their profile from admin area -> WPUF Subscription -> Post Count: | |
November 8, 2013 at 10:52 pm 9869 | |
Hello Mahi, I think this is not correct. The user pays for a number of posts within a certain date and he can edit and delete posts as often as he wants. The counter should reflect these changes. The easy example, if the user has ordered 3 posts and he created all three, if he removes one post, the counter should be in 2, the user still has the possibility of creating a new post. This is possible? Thanks! | |
November 10, 2013 at 8:47 pm 9927 | |
Is there anyone who can answer that? Thanks. | |
November 11, 2013 at 12:48 am 9930 | |
WPUF doesn’t do any sort of increasing count once a post is deleted. But if you think you need this feature, here is the code may be you could use. Paste it to your themes functions.php and see if it solves your problem. [php] $author_id = get_post_field( ‘post_author’, $post_id ); $count = ( $userdata->wpuf_sub_pcount ) ? $userdata->wpuf_sub_pcount : 0; add_action( ‘wp_trash_post’, ‘wpufe_trash_post’ ); | |
November 11, 2013 at 4:01 am 9939 | |
Thank you very much, that is a very important part for my project. The code works but partially. For example, if the user has a limit of 3 post, if he writes two posts and then deletes one or two posts, this works perfectly, the counter reflect these changes. But if you write three posts (3 of 3), there is a error: the counter no reflect these changes, remains at 0 even remove the three posts and the user can not create a post. Thanks. | |
November 12, 2013 at 12:14 am 9960 | |
So you are saying, if he write 3 posts and then deletes 1 or 2 posts, it doesn’t increase the limit? | |
November 12, 2013 at 3:15 am 9973 | |
An example: The limit is 3 posts. If I write 1 or 2 posts and then delete 1 or 2 posts, the limit increases. This is perfect. The error is if I write 3 posts (the limit is 3), then the counter is at zero and I can not write more posts. If I delete all posts, the counter also continues to zero. Thanks! | |
November 13, 2013 at 3:58 am 10014 | |
Tareq, can you help me with this, please? | |
November 15, 2013 at 9:48 pm 10117 | |
In the code, replace | |
November 17, 2013 at 9:28 pm 10210 | |
It works perfectly!! Thank you very much! |