本文整理汇总了PHP中FLBuilderModel::get_user_templates方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::get_user_templates方法的具体用法?PHP FLBuilderModel::get_user_templates怎么用?PHP FLBuilderModel::get_user_templates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::get_user_templates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_template_selector
/**
* Renders the markup for the template selector.
*
* @since 1.0
* @return array
*/
public static function render_template_selector()
{
if (file_exists(FL_BUILDER_DIR . 'includes/template-selector.php')) {
$enabled_templates = FLBuilderModel::get_enabled_templates();
$user_templates = FLBuilderModel::get_user_templates();
$templates = FLBuilderModel::get_template_selector_data();
ob_start();
include FL_BUILDER_DIR . 'includes/template-selector.php';
$html = ob_get_clean();
return array('html' => $html);
}
}
示例2: render_template_selector
/**
* Renders the markup for the template selector.
*
* @since 1.0
* @return void
*/
public static function render_template_selector()
{
if (file_exists(FL_BUILDER_DIR . 'includes/template-selector.php')) {
$enabled_templates = FLBuilderModel::get_enabled_templates();
$user_templates = FLBuilderModel::get_user_templates();
$templates = FLBuilderModel::get_template_selector_data();
include FL_BUILDER_DIR . 'includes/template-selector.php';
if (defined('DOING_AJAX')) {
die;
}
}
}
示例3: get_selector_data
/**
* Returns data for overriding core templates in
* the template selector.
*
* @since 1.5.7
* @param string $type The type of user template to return.
* @return array|bool
*/
public static function get_selector_data($type = 'layout')
{
$site_id = self::get_source_site_id();
if ($site_id && $type) {
if (is_multisite()) {
switch_to_blog($site_id);
}
$data = FLBuilderModel::get_user_templates($type);
if (is_multisite()) {
restore_current_blog();
}
return count($data['templates']) > 0 ? $data : false;
}
return false;
}