本文整理汇总了PHP中ot_list_item_view函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_list_item_view函数的具体用法?PHP ot_list_item_view怎么用?PHP ot_list_item_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ot_list_item_view函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ot_type_slider
function ot_type_slider($args = array())
{
/* turns arguments array into variables */
extract($args);
/* verify a description */
$has_desc = $field_desc ? true : false;
/* format setting outer wrapper */
echo '<div class="format-setting type-slider ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
/* description */
echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
/* format setting inner wrapper */
echo '<div class="format-setting-inner">';
/* pass the settings array arround */
echo '<input type="hidden" name="' . esc_attr($field_id) . '_settings_array" id="' . esc_attr($field_id) . '_settings_array" value="' . ot_encode(serialize($field_settings)) . '" />';
/**
* settings pages have array wrappers like 'option_tree'.
* So we need that value to create a proper array to save to.
* This is only for NON metabox settings.
*/
if (!isset($get_option)) {
$get_option = '';
}
/* build list items */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" data-name="' . esc_attr($field_id) . '" data-id="' . esc_attr($post_id) . '" data-get-option="' . esc_attr($get_option) . '" data-type="' . esc_attr($type) . '">';
if (is_array($field_value) && !empty($field_value)) {
foreach ($field_value as $key => $list_item) {
echo '<li class="ui-state-default list-list-item">';
ot_list_item_view($field_id, $key, $list_item, $post_id, $get_option, $field_settings, $type);
echo '</li>';
}
}
echo '</ul>';
/* button */
echo '<a href="javascript:void(0);" class="option-tree-list-item-add option-tree-ui-button button button-primary right hug-right" title="' . __('Add New', 'option-tree') . '">' . __('Add New', 'option-tree') . '</a>';
/* description */
echo '<div class="list-item-description">' . __('You can re-order with drag & drop, the order will update after saving.', 'option-tree') . '</div>';
echo '</div>';
echo '</div>';
}
示例2: add_list_item
/**
* AJAX utility function for adding a new list item.
*/
public function add_list_item()
{
ot_list_item_view($_REQUEST['name'], $_REQUEST['count'], array(), $_REQUEST['post_id'], $_REQUEST['get_option'], unserialize(ot_decode($_REQUEST['settings'])), $_REQUEST['type']);
die;
}
示例3: add_list_item
/**
* AJAX utility function for adding a new list item.
*/
public function add_list_item()
{
check_ajax_referer('option_tree', 'nonce');
ot_list_item_view($_REQUEST['name'], $_REQUEST['count'], array(), $_REQUEST['post_id'], $_REQUEST['get_option'], unserialize(ot_decode($_REQUEST['settings'])), $_REQUEST['type']);
die;
}