Home Forums Plugin Support WP User Frontend (Free Version) How to increase the remaining posts number when post is deleted

This topic is: not resolved

This topic contains 10 replies, has 3 voices, and was last updated by  Nayem 3 years, 8 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #61322

    Jose
    Member
    Post count: 36

    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.

    #64255

    towhid
    Participant
    Post count: 4505

    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

    #65172

    Jose
    Member
    Post count: 36

    Any news?

    #65174

    Nayem
    Moderator
    Post count: 6480

    Hello Jose,

    I have sent an e-mail to you with a file attachment. Please check your mail.

    Thanks.

    #65185

    Jose
    Member
    Post count: 36

    Perfect!. Now, how do I prevent that from being overwritten when an updates comes?

    #65187

    Nayem
    Moderator
    Post count: 6480

    Hello,

    Just create a backup of this file.

    #65815

    Jose
    Member
    Post count: 36

    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.

    #65829

    Jose
    Member
    Post count: 36

    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…

    #65911

    Nayem
    Moderator
    Post count: 6480

    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.

    #66458

    Jose
    Member
    Post count: 36

    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.

    #66565

    Nayem
    Moderator
    Post count: 6480

    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.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘How to increase the remaining posts number when post is deleted’ is closed to new replies.