This members-only tutorial shows how tutor_get_template_path filter can be used to override Tutor's templates from a specific directory inside the My Custom functionality plugin.

This is especially useful when using Oxygen since Oxygen disables the active theme.

A member asked:

I would like to override 2 files from following directories:

1) wp-content/plugins/tutor/templates/dashboard/registration.php

2) wp-content/plugins/tutor/templates/dashboard/instructor/registration.php

dashboard/registration.php is used for the display of Student Registration page (https://example.com/student-registration/)

and

dashboard/instructor/registration.php is used for the display of Instructor Registration page (https://example.com/instructor-registration/).

We can extract the template name from the template location that Tutor supplies with the filter, append it to custom plugin's template path and return this new location to Tutor so it looks for each template in the custom plugin and use it if present or the one from Tutor if not.

Step 1

Install and activate My Custom Functionality plugin.

Connect to your hosting account using a FTP client and navigate to site's /wp-content/plugins/my-custom-functionality-master.

Edit plugin.php and add the following at the end:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: