Overwrite plugin with sage

Hello,
I want to overwrite wordpress plugin file with Sage

  • File is located under plugindirectory/filename.html.php
    to be replaced in :
    themedirectory/pluginpath/filename.html.php or blade php
    I have googled for any solution , the only one found is for woocommerce
    Thanks in advance

It depends on the plugin. Does the plugin in question use the WordPress template loading? Then the template can be overridden using a filter. Otherwise the plugin itself should offer a filter for the template path.

the plugin is WP Abstracts.
It has some filters

You mean this plugin, right?

What file should be overridden in the plugin?
https://plugins.trac.wordpress.org/browser/wp-abstracts-manuscripts-manager/tags/2.5.1

Yes users/register.html.php

In that plugin the path to the PHP template file is hardcoded, with no filter used:
https://plugins.trac.wordpress.org/browser/wp-abstracts-manuscripts-manager/tags/2.5.1/users/users.register.php#L82
The PHP template file is simply included into an output buffer and then echoed anyway,
so there is also no filter/action available for changing the complete rendered HTML.

You can create a new issue on the plugin issue tracker and request filters for those templates:

Until the author has added this functionality, you can fork the plugin (on GitHub, private GitLab, or some other repository, depending on the deployment flow you are using), add the filters by yourself and use those filters in your e.g. theme or site plugin to let the plugin use your own, custom template files instead.

Thanks for your help , I have created an isssue and I will keep you updated about what I will get . But till now nothing to say

Stilll have problem in overriding plugin

The plugin author responded that those filters aren’t going to be added in the very near future:
(Custom Registration sage wordpress | WordPress.org)

Hi,
Unfortunately we don’t have filers for those at the moment but will consider adding some in future releases.

Alternately, you can simply replace include_once(WPABSTRACTS_PLUGIN_DIR . ‘users/register.html.php’); in the register.php file with the path of your custom template when the filters are added in the future you can simply add a filter with the path to your custom template for the same effect.

Please let me know if you have more questions,

Kevon A

So until this feature is added to the plugin, you would want to fork the whole plugin repository and add the filters yourself so you can override them in your theme/site plugin.
I haven’t found a GitHub repository for this plugin code, but plugins on the WordPress plugin directory all have their dedicated SVN repository:
https://plugins.trac.wordpress.org/browser/wp-abstracts-manuscripts-manager/trunk

So you can use svn checkout to clone that repository to your workstation and add the modifications on top (as separate branch preferably) - or import it in git and do the fork there. In the end you would install the plugin you forked from your own repository (e.g. privately hosted on GitHub or GitLab, whatever you choose) with the added filters.

This tutorial may be helpful for you:
https://ben.lobaugh.net/blog/90633/creating-a-synchronized-github-fork-of-a-wordpress-org-subversion-plugin-repository

And for installing the forked plugin from your own repository using composer (on a Bedrock site):
https://roots.io/guides/private-or-commercial-wordpress-plugins-as-composer-dependencies/