| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template Loader for Plugins. |
| 4 |
* |
| 5 |
* @package Gamajo_Template_Loader |
| 6 |
* @author Gary Jones |
| 7 |
* @link http://github.com/GaryJones/Gamajo-Template-Loader |
| 8 |
* @copyright 2013 Gary Jones |
| 9 |
* @license GPL-2.0-or-later |
| 10 |
* @version 1.3.1 |
| 11 |
*/ |
| 12 |
|
| 13 |
namespace Friends; |
| 14 |
|
| 15 |
if ( ! class_exists( '\Gamajo_Template_Loader_1_4_0' ) ) { |
| 16 |
require __DIR__ . '/class-gamajo-template-loader-1-4-0.php'; |
| 17 |
} |
| 18 |
/** |
| 19 |
* Template loader. |
| 20 |
* |
| 21 |
* Originally based on functions in Easy Digital Downloads (thanks Pippin!). |
| 22 |
|
| 23 |
* @package Friends |
| 24 |
* @author Alex Kirk |
| 25 |
*/ |
| 26 |
class Template_Loader extends \Gamajo_Template_Loader_1_4_0 { |
| 27 |
/** |
| 28 |
* Prefix for filter names. |
| 29 |
* |
| 30 |
* @since 1.0.0 |
| 31 |
* |
| 32 |
* @var string |
| 33 |
*/ |
| 34 |
protected $filter_prefix = 'friends'; |
| 35 |
|
| 36 |
/** |
| 37 |
* Directory name where custom templates for this plugin should be found in the theme. |
| 38 |
* |
| 39 |
* For example: 'your-plugin-templates'. |
| 40 |
* |
| 41 |
* @since 1.0.0 |
| 42 |
* |
| 43 |
* @var string |
| 44 |
*/ |
| 45 |
protected $theme_template_directory = 'friends'; |
| 46 |
|
| 47 |
/** |
| 48 |
* Reference to the root directory path of this plugin. |
| 49 |
* |
| 50 |
* Can either be a defined constant, or a relative reference from where the subclass lives. |
| 51 |
* |
| 52 |
* e.g. YOUR_PLUGIN_TEMPLATE or plugin_dir_path( dirname( __FILE__ ) ); etc. |
| 53 |
* |
| 54 |
* @since 1.0.0 |
| 55 |
* |
| 56 |
* @var string |
| 57 |
*/ |
| 58 |
protected $plugin_directory = FRIENDS_PLUGIN_DIR; |
| 59 |
|
| 60 |
/** |
| 61 |
* Directory name where templates are found in this plugin. |
| 62 |
* |
| 63 |
* Can either be a defined constant, or a relative reference from where the subclass lives. |
| 64 |
* |
| 65 |
* e.g. 'templates' or 'includes/templates', etc. |
| 66 |
* |
| 67 |
* @since 1.1.0 |
| 68 |
* |
| 69 |
* @var string |
| 70 |
*/ |
| 71 |
protected $plugin_template_directory = 'templates'; |
| 72 |
} |
| 73 |
|