本文整理汇总了PHP中ot_layout_view函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_layout_view函数的具体用法?PHP ot_layout_view怎么用?PHP ot_layout_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ot_layout_view函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_layout
/**
* AJAX utility function for adding a new layout.
*/
public function add_layout()
{
echo ot_layout_view($_REQUEST['count']);
die;
}
示例2: ot_type_modify_layouts
function ot_type_modify_layouts()
{
echo '<form method="post" id="option-tree-settings-form">';
/* form nonce */
wp_nonce_field('option_tree_modify_layouts_form', 'option_tree_modify_layouts_nonce');
/* format setting outer wrapper */
echo '<div class="format-setting type-textarea has-desc">';
/* description */
echo '<div class="description">';
echo '<p>' . __('To add a new layout enter a unique lower case alphanumeric string (dashes allowed) in the text field and click "Save Layouts".', 'option-tree') . '</p>';
echo '<p>' . __('As well, you can activate, remove, and drag & drop the order; all situations require you to click "Save Layouts" for the changes to be applied.', 'option-tree') . '</p>';
echo '<p>' . __('When you create a new layout it will become active and any changes made to the Theme Options will be applied to it. If you switch back to a different layout immediately after creating a new layout that new layout will have a snapshot of the current Theme Options data attached to it.', 'option-tree') . '</p>';
if (OT_SHOW_DOCS) {
echo '<p>' . __('Visit <code>OptionTree->Documentation->Layouts Overview</code> to see a more in-depth description of what layouts are and how to use them.', 'option-tree') . '</p>';
}
echo '</div>';
echo '<div class="format-setting-inner">';
/* get the saved layouts */
$layouts = get_option(ot_layouts_id());
/* set active layout */
$active_layout = isset($layouts['active_layout']) ? $layouts['active_layout'] : '';
echo '<input type="hidden" name="' . ot_layouts_id() . '[active_layout]" value="' . esc_attr($active_layout) . '" class="active-layout-input" />';
/* add new layout */
echo '<input type="text" name="' . ot_layouts_id() . '[_add_new_layout_]" value="" class="widefat option-tree-ui-input" autocomplete="off" />';
/* loop through each layout */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_layouts">';
if (is_array($layouts) && !empty($layouts)) {
foreach ($layouts as $key => $data) {
/* skip active layout array */
if ($key == 'active_layout') {
continue;
}
/* content */
echo '<li class="ui-state-default list-layouts">' . ot_layout_view($key, $data, $active_layout) . '</li>';
}
}
echo '</ul>';
echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Layouts', 'option-tree') . '</button>';
echo '</div>';
echo '</div>';
echo '</form>';
}