本文整理汇总了PHP中WPBakeryVisualComposer::getUserTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP WPBakeryVisualComposer::getUserTemplate方法的具体用法?PHP WPBakeryVisualComposer::getUserTemplate怎么用?PHP WPBakeryVisualComposer::getUserTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPBakeryVisualComposer
的用法示例。
在下文中一共展示了WPBakeryVisualComposer::getUserTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findShortcodeTemplate
/**
* Find html template for shortcode output.
*/
protected function findShortcodeTemplate()
{
// Check template path in shortcode's mapping settings
if (!empty($this->settings['html_template']) && is_file($this->settings('html_template'))) {
return $this->setTemplate($this->settings['html_template']);
}
// Check template in theme directory
$user_template = WPBakeryVisualComposer::getUserTemplate($this->getFilename() . '.php');
if (is_file($user_template)) {
return $this->setTemplate($user_template);
}
// Check default place
$default_dir = $this->getVcTableDefaultDir();
if (is_file($default_dir . $this->getFilename() . '.php')) {
return $this->setTemplate($default_dir . $this->getFilename() . '.php');
}
}
示例2: getTemplatePath
public function getTemplatePath($key)
{
$template = isset($this->templates[$key]) ? $this->templates[$key] : false;
if (!$template) {
return false;
}
// Check template path in shortcode's mapping settings
if (is_array($template) && isset($template['path']) && !empty($template['path'])) {
return $template['path'];
}
// Check template in theme directory
$user_template = WPBakeryVisualComposer::getUserTemplate($this->getFileName($key));
if (is_file($user_template)) {
return $this->setTemplate($key, $user_template);
}
// Check default place
$default_dir = WPBakeryVisualComposer::defaultTemplatesDIR();
if (is_file($default_dir . $this->getFilename($key))) {
return $this->setTemplate($key, $default_dir . $this->getFileName($key));
}
}
示例3: findBlockTemplate
protected function findBlockTemplate()
{
$template_path = $this->block_template_dir_name . '/' . $this->block_template_filename;
// Check template path in shortcode's mapping settings
if (!empty($this->settings['html_template']) && is_file($this->settings('html_template') . $template_path)) {
return $this->settings['html_template'] . $template_path;
}
// Check template in theme directory
$user_template = WPBakeryVisualComposer::getUserTemplate($template_path);
if (is_file($user_template)) {
return $user_template;
}
// Check default place
$default_dir = WPBakeryVisualComposer::defaultTemplatesDIR();
if (is_file($default_dir . $template_path)) {
return $default_dir . $template_path;
}
return $template_path;
}
示例4: getPartial
protected function getPartial($partial)
{
// Check template path in shortcode's mapping settings
if (isset($this->partial_paths[$partial])) {
return $this->partial_paths[$partial];
}
// Check template in theme directory
$user_template = WPBakeryVisualComposer::getUserTemplate($this->getPartialFilename($partial));
if (is_file($user_template)) {
return $this->setPartialTemplate($partial, $user_template);
}
// Check default place
$default_dir = WPBakeryVisualComposer::defaultTemplatesDIR();
$default_dir . $this->getPartialFilename($partial);
if (is_file($default_dir . $this->getPartialFilename($partial))) {
return $this->setPartialTemplate($partial, $default_dir . $this->getPartialFilename($partial));
}
}