本文整理汇总了PHP中FLBuilderModel::get_layout_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP FLBuilderModel::get_layout_settings方法的具体用法?PHP FLBuilderModel::get_layout_settings怎么用?PHP FLBuilderModel::get_layout_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLBuilderModel
的用法示例。
在下文中一共展示了FLBuilderModel::get_layout_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_global_nodes_custom_code
/**
* Renders the custom CSS or JS for all global nodes in a layout.
*
* @since 1.7
*/
public static function render_global_nodes_custom_code($type = 'css')
{
$code = '';
$rendered = array();
if (!FLBuilderModel::is_post_node_template()) {
$nodes = FLBuilderModel::get_layout_data();
$node_status = FLBuilderModel::get_node_status();
foreach ($nodes as $node_id => $node) {
$template_post_id = FLBuilderModel::is_node_global($node);
if ($template_post_id && !in_array($template_post_id, $rendered)) {
$rendered[] = $template_post_id;
$code .= FLBuilderModel::get_layout_settings($node_status, $template_post_id)->{$type};
}
}
}
return $code;
}
示例2: 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;
}