How to increase the remaining posts number when post is deleted
Author | Posts |
---|---|
July 28, 2015 at 8:18 pm 61322 | |
Nayem | Regarding the support post at:
https://wordpress.org/support/topic/number-of-remaining-posts-not-updated-when-post-deleted?replies=2
joseamirandavelez wrote:
I have the number of posts set to 1 post in the package. When the user creates a post it is set to 0. If the user deletes the post, it is not updated to 1. So the user cannot create a new post unless I manually delete and re-add the package to his account. Also, if i try to update the post quantity in his account and click update, WordPress gives me a "Are you sure you want to do that." error. Thats why I have to delete the package and re-add it.webDevs wrote: Hello, When you will delete a post it will not increase the post remaining number. This is the default feature of subscription. You have to add custom code to get this feature. If you want then I can provide you the file which you have to replace with one of the plugin file. You can create a topic in our support forum about this. Thanks.Can you please provide the file I have to replace? Thanks. |
July 29, 2015 at 6:14 pm 64255 | |
towhid | Hello Jose, I have already forwarded this issue to our developer team. Please allow me some time. Hope I will come back to you a right solution. Thanks |
August 4, 2015 at 11:22 am 65172 | |
Jose | Any news? |
August 4, 2015 at 11:29 am 65174 | |
Nayem | Hello Jose, I have sent an e-mail to you with a file attachment. Please check your mail. Thanks. |
August 4, 2015 at 11:58 am 65185 | |
Jose | Perfect!. Now, how do I prevent that from being overwritten when an updates comes? |
August 4, 2015 at 12:11 pm 65187 | |
Nayem | Hello, Just create a backup of this file. |
August 7, 2015 at 4:07 am 65815 | |
Jose | Yeah but what if you guys modify something in that file in the future? If I overwrite a new file with the one you sent, the plugin may break. |
August 7, 2015 at 11:23 am 65829 | |
Jose | I have been researching this and the only way I can make sure that this isnt overwritten in the future with an update is if you guys either make this part of the production version by providing a setting, or provide a way for users to override the function you modified in the file you sent me, maybe by allowing redefinition of the function or any other method… Otherwise I will have to manually check if you guys made changes to the file and merge the files as appropriate if I want to keep the plugin updated… |
August 8, 2015 at 10:58 am 65911 | |
Nayem | Hello Jose, That feature which you have got is not requested to implement. So, if we get more request for this feature then we will permanently add this into our plugin. Otherwise you have to manually replace the file. I will discuss with our developer to implement this feature in our next release. Thanks. |
August 11, 2015 at 12:28 pm 66458 | |
Jose | Im not asking you to implement the feature, but to provide an override to the function so that I can include the modified function in a separate file (themes functions.php). This can be easily done by adding a simple if function exists statement. Literally two lines of code. |
August 11, 2015 at 7:00 pm 66565 | |
Nayem | Hello, I will discuss with our developer about this. If there is any hook or filter then it will possible to override from another place. I will be back to you soon. Thanks. |