Added filter for template include path #6

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant
@inspectorfegter

This gives plugins and child themes the flexibility to alter the include path. A use case is allowing users to define Page Templates for custom post types. Instead of creating multiple exact templates for each slug, one alternate template can be used and included via the filter.

Added filter hook for template file path.
This gives plugins and child themes the flexibility to alter the include path.
@@ -329,6 +329,9 @@ function cfct_template_file($dir, $file, $data = array()) {
$_cfct_filepath = CFCT_PATH.$dir.'/'.$file.'.php';
}
}
+
+ $_cfct_filepath = apply_filters('cfct_template_include', $_cfct_filepath, $dir, $file, $data);

This comment has been minimized.

Show comment Hide comment
@inspectorfegter

inspectorfegter Oct 17, 2012

This allows developers to further extend the logic of Carrington Core alternate template hierarchy.

@inspectorfegter

inspectorfegter Oct 17, 2012

This allows developers to further extend the logic of Carrington Core alternate template hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment