PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Core/FileManager.php +10 -6 6.5.0 → 8.0.2 View file →
@@ -94,10 +94,10 @@
94 94 *
95 95 * @param string $__template
96 96 * @param array $__variables
97 97 */
98 - public function includeTemplate( $__template, array $__variables = array() ) {
99 - $__template = $this->locateTemplate( $__template );
98 + public function includeTemplate( $__template, array $__variables = array(), $__default_path = '' ) {
99 + $__template = $this->locateTemplate( $__template, $__default_path );
100 100
101 101 if ( $__template ) {
102 102 allowedExtract( $__variables );
103 103
@@ -115,11 +115,11 @@
115 115 * @param array $variables
116 116 *
117 117 * @return string
118 118 */
119 - public function renderTemplate( $template, array $variables = array() ) {
119 + public function renderTemplate( $template, array $variables = array(), $default_path = '' ) {
120 120 ob_start();
121 - $this->includeTemplate( $template, $variables );
121 + $this->includeTemplate( $template, $variables, $default_path );
122 122 $content = ob_get_contents();
123 123 ob_end_clean();
124 124
125 125 return $content;
@@ -182,11 +182,15 @@
182 182 * @param string $template
183 183 *
184 184 * @return string
185 185 */
186 - public function locateTemplate( $template ) {
186 + public function locateTemplate( $template, $default_path = '' ) {
187 187
188 - $file = $this->pluginDirectory . 'views/' . $template;
188 + if ( $default_path ) {
189 + $file = trailingslashit( $default_path ) . $template;
190 + } else {
191 + $file = $this->pluginDirectory . 'views/' . $template;
192 + }
189 193
190 194 if ( strpos( $template, 'frontend/' ) === 0 ) {
191 195
192 196 $frontendTemplate = str_replace( 'frontend/', '', $template );