Updating the plugin deletes custom templates

Viewing 7 posts - 1 through 7 (of 7 total)
#187927

Matt Fond
Participant

Hi, since the Support forum is not searchable I couldn’t easily find if this is already answered.

Why when the plugin is updated, the custom created .php template files are deleted too? Can’t you preserve them or have an option to put them in a separate folder that will not delete them when updating?

#187936

Tanvir
Moderator

Hello,

Thanks for contacting us.
If you create the templates in active theme file, then when you update the plugin it will not be deleted.
But if you update the parent theme and custom templates are in it, then it will be deleted.
So it is recommended to keep those in activated child theme

Regards
Tanvir

#187943

Matt Fond
Participant

Hi, I think we misunderstood each other. I was thinking on download-manager link template files located here:

/wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-default.php

If I create a new .php template file as instructed in the Admin message on top, then if the plugin get’s updated it deletes those files. How can that be avoided?

Thank you

#187962

Tanvir
Moderator

Hi Matt,

Thanks for the clarification. It is clear to me now.

You can follow the doc below and my suggestion in previous reply. It will not delete the files as those will be kept in child theme.

Template Files

Regards
Tanvir

#187996

Matt Fond
Participant

Hi, I tried your method before I contacted you here, but for some reason this does not work for me.

Here is the “original” file path:
/public_html/wp-content/plugins/download-manager/src/Package/views/link-templates/link-template-custom.php

If I move that file here:
/public_html/wp-content/themes/twentytwentyone-child/download-manager/src/Package/views/link-templates/link-template-custom.php

by your instructions then this should work, but it does not.
In the place where this code should be displayed on the site I only get:
link-template-custom.php, meaning that it still is looking for this file on the “original” location rather than in the “active theme” download-manager folder. Do you have any idea why this is happening?

Thank you

#187997

Matt Fond
Participant

Hi, sorry, I’m stupid.

I was using original folder structure, but custom link template file only needs to go here, not the full original structure /{active-theme}/download-manager/link-templates

My bad. Thank you!

#188027

Tanvir
Moderator

You are welcome.
Don’t hesitate to open a new topic if you face another issue.

Regards
Tanvir

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

You must be logged in to reply to this topic.