本文整理汇总了PHP中FLBuilderModel::get_user_template_type方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::get_user_template_type方法的具体用法?PHP FLBuilderModel::get_user_template_type怎么用?PHP FLBuilderModel::get_user_template_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::get_user_template_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
} else {
$campaign = 'buy-button';
}
echo FLBuilderModel::get_upgrade_url(array('utm_source' => 'external', 'utm_medium' => 'builder', 'utm_campaign' => $campaign));
?>
',
userCanEditGlobalTemplates: <?php
if (current_user_can(FLBuilderModel::get_global_templates_editing_capability())) {
echo 'true';
} else {
echo 'false';
}
?>
,
userTemplateType: '<?php
echo FLBuilderModel::get_user_template_type();
?>
'
};
var FLBuilderStrings = {
actionsLightboxTitle: '<?php
esc_attr_e('What would you like to do?', 'fl-builder');
?>
',
cancel: '<?php
esc_attr_e('Cancel', 'fl-builder');
?>
',
changeTemplate: '<?php
esc_attr_e('Change Template', 'fl-builder');
示例2: render_content_classes
/**
* Renders the CSS classes for the main content div tag.
*
* @since 1.6.4
* @return string
*/
public static function render_content_classes()
{
// Build the content class.
$classes = 'fl-builder-content fl-builder-content-' . FLBuilderModel::get_post_id();
// Add template classes to the content class.
if (FLBuilderModel::is_post_user_template()) {
$classes .= ' fl-builder-template';
$classes .= ' fl-builder-' . FLBuilderModel::get_user_template_type() . '-template';
}
// Add the global templates locked class.
if (!current_user_can(FLBuilderModel::get_global_templates_editing_capability())) {
$classes .= ' fl-builder-global-templates-locked';
}
// Add browser specific classes.
if (isset($_SERVER['HTTP_USER_AGENT'])) {
if (stristr($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0') && stristr($_SERVER['HTTP_USER_AGENT'], 'rv:11.0')) {
$classes .= ' fl-builder-ie-11';
}
}
return $classes;
}
示例3: apply_node
/**
* Applies a node template that is defined as network-wide.
*
* @since 1.6.3
* @param int $template_id The node template post ID.
* @param string $parent_id The new parent node ID for the template.
* @param int $position The position of the template within the layout.
* @return void
*/
public static function apply_node($template_id = null, $parent_id = null, $position = 0)
{
$site_id = self::get_source_site_id();
$template = new StdClass();
if ($site_id) {
if (is_multisite()) {
switch_to_blog($site_id);
}
$template->data = FLBuilderModel::get_layout_data('published', $template_id);
$template->settings = FLBuilderModel::get_layout_settings('published', $template_id);
$template->type = FLBuilderModel::get_user_template_type($template_id);
$template->global = false;
if (is_multisite()) {
restore_current_blog();
}
return FLBuilderModel::apply_node_template($template_id, $parent_id, $position, $template);
}
return false;
}