本文整理汇总了PHP中Redux_Helpers::get_template_version方法的典型用法代码示例。如果您正苦于以下问题:PHP Redux_Helpers::get_template_version方法的具体用法?PHP Redux_Helpers::get_template_version怎么用?PHP Redux_Helpers::get_template_version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redux_Helpers
的用法示例。
在下文中一共展示了Redux_Helpers::get_template_version方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExtensions
public static function getExtensions($opt_name = "", $key = "")
{
if (empty($opt_name)) {
Redux::getAllExtensions();
if (empty($key)) {
return self::$extension_paths;
} else {
if (isset(self::$extension_paths[$key])) {
return self::$extension_paths[$key];
}
}
} else {
if (empty(self::$uses_extensions[$opt_name])) {
Redux::getInstanceExtensions($opt_name);
}
if (empty(self::$uses_extensions[$opt_name])) {
return false;
}
$instanceExtensions = array();
foreach (self::$uses_extensions[$opt_name] as $extension) {
$class_file = end(self::$extensions[$extension]);
$name = str_replace('.php', '', basename($extension));
$extension_class = 'ReduxFramework_Extension_' . $name;
$instanceExtensions[$extension] = array('path' => $class_file, 'class' => $extension_class, 'version' => Redux_Helpers::get_template_version($class_file));
}
return $instanceExtensions;
}
return false;
}
示例2: template_file_check_notice
/**
* Show a notice highlighting bad template files
*/
public function template_file_check_notice()
{
if ($this->template_path == $this->original_path) {
return;
}
$core_templates = $this->scan_template_files($this->original_path);
$outdated = false;
foreach ($core_templates as $file) {
$developer_theme_file = false;
if (file_exists($this->template_path . $file)) {
$developer_theme_file = $this->template_path . $file;
}
if ($developer_theme_file) {
$core_version = Redux_Helpers::get_template_version($this->original_path . $file);
$developer_version = Redux_Helpers::get_template_version($developer_theme_file);
if ($core_version && $developer_version && version_compare($developer_version, $core_version, '<')) {
?>
<div id="message" class="error redux-message">
<p><?php
esc_html_e('<strong>Your panel has bundled outdated copies of Redux Framework template files</strong> – if you encounter functionality issues this could be the reason. Ensure you update or remove them.', 'redux-framework');
?>
</p>
</div>
<?php
return;
}
}
}
}