Skip to content

Commit 64f036b

Browse files
authored
Merge pull request #6 from Jmayhak/patch-1
Add priority to load function
2 parents 01c599f + 5040174 commit 64f036b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Routes.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ public static function convert_route($route_string) {
9797
* @param int $status_code A code for the status (ex: 200)
9898
* @param WP_Query $query Use a WP_Query object in the template file instead of
9999
* the default query
100+
* @param int $priority The priority used by the "template_include" filter
100101
* @return bool
101102
*/
102-
public static function load($template, $tparams = false, $query = false, $status_code = 200) {
103+
public static function load($template, $tparams = false, $query = false, $status_code = 200, $priority = 10) {
103104
$fullPath = is_readable($template);
104105
if (!$fullPath) {
105106
$template = locate_template($template);
@@ -146,7 +147,7 @@ public static function load($template, $tparams = false, $query = false, $status
146147
if ($template) {
147148
add_filter('template_include', function($t) use ($template) {
148149
return $template;
149-
});
150+
}, $priority);
150151
return true;
151152
}
152153
return false;

0 commit comments

Comments
 (0)