本文整理汇总了PHP中ot_settings_view函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_settings_view函数的具体用法?PHP ot_settings_view怎么用?PHP ot_settings_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ot_settings_view函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_list_item_setting
/**
* AJAX utility function for adding a new list item setting.
*/
public function add_list_item_setting()
{
echo ot_settings_view($_REQUEST['name'] . '[settings]', $_REQUEST['count']);
die;
}
示例2: ot_type_theme_options_ui
function ot_type_theme_options_ui()
{
global $blog_id;
echo '<form method="post" id="option-tree-settings-form">';
/* form nonce */
wp_nonce_field('option_tree_settings_form', 'option_tree_settings_nonce');
/* format setting outer wrapper */
echo '<div class="format-setting type-textblock has-desc">';
/* description */
echo '<div class="description">';
echo '<h4>' . __('Warning!', 'option-tree') . '</h4>';
echo '<p class="warning">' . sprintf(__('Go to the %s page if you want to save data, this page is for adding settings.', 'option-tree'), '<a href="' . get_admin_url($blog_id, 'themes.php?page=ot-theme-options') . '"><code>Appearance->Theme Options</code></a>') . '</p>';
echo '<p class="warning">' . sprintf(__('If you\'re unsure or not completely positive that you should be editing these settings, you should read the %s first.', 'option-tree'), '<a href="' . get_admin_url($blog_id, 'admin.php?page=ot-documentation') . '"><code>OptionTree->Documentation</code></a>') . '</p>';
echo '<h4>' . __('Things could break or be improperly displayed to the end-user if you do one of the following:', 'option-tree') . '</h4>';
echo '<p class="warning">' . __('Give two sections the same ID, give two settings the same ID, give two contextual help content areas the same ID, don\'t create any settings, or have a section at the end of the settings list.', 'option-tree') . '</p>';
echo '<p>' . __('You can create as many settings as your project requires and use them how you see fit. When you add a setting here, it will be available on the Theme Options page for use in your theme. To separate your settings into sections, click the "Add Section" button, fill in the input fields, and a new navigation menu item will be created.', 'option-tree') . '</p>';
echo '<p>' . __('All of the settings can be sorted and rearranged to your liking with Drag & Drop. Don\'t worry about the order in which you create your settings, you can always reorder them.', 'option-tree') . '</p>';
echo '</div>';
/* get the saved settings */
$settings = get_option(ot_settings_id());
/* wrap settings array */
echo '<div class="format-setting-inner">';
/* set count to zero */
$count = 0;
/* loop through each section and its settings */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="' . ot_settings_id() . '[settings]">';
if (isset($settings['sections'])) {
foreach ($settings['sections'] as $section) {
/* section */
echo '<li class="' . ($count == 0 ? 'ui-state-disabled' : 'ui-state-default') . ' list-section">' . ot_sections_view(ot_settings_id() . '[sections]', $count, $section) . '</li>';
/* increment item count */
$count++;
/* settings in this section */
if (isset($settings['settings'])) {
foreach ($settings['settings'] as $setting) {
if (isset($setting['section']) && $setting['section'] == $section['id']) {
echo '<li class="ui-state-default list-setting">' . ot_settings_view(ot_settings_id() . '[settings]', $count, $setting) . '</li>';
/* increment item count */
$count++;
}
}
}
}
}
echo '</ul>';
/* buttons */
echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button button hug-left">' . __('Add Section', 'option-tree') . '</a>';
echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button button">' . __('Add Setting', 'option-tree') . '</a>';
echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
/* sidebar textarea */
echo '
<div class="format-setting-label" id="contextual-help-label">
<h3 class="label">' . __('Contextual Help', 'option-tree') . '</h3>
</div>
<div class="format-settings" id="contextual-help-setting">
<div class="format-setting type-textarea no-desc">
<div class="description"><strong>' . __('Contextual Help Sidebar', 'option-tree') . '</strong>: ' . __('If you decide to add contextual help to the Theme Option page, enter the optional "Sidebar" HTML here. This would be an extremely useful place to add links to your themes documentation or support forum. Only after you\'ve added some content below will this display to the user.', 'option-tree') . '</div>
<div class="format-setting-inner">
<textarea class="textarea" rows="10" cols="40" name="' . ot_settings_id() . '[contextual_help][sidebar]">' . (isset($settings['contextual_help']['sidebar']) ? esc_html($settings['contextual_help']['sidebar']) : '') . '</textarea>
</div>
</div>
</div>';
/* set count to zero */
$count = 0;
/* loop through each contextual_help content section */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="' . ot_settings_id() . '[contextual_help][content]">';
if (isset($settings['contextual_help']['content'])) {
foreach ($settings['contextual_help']['content'] as $content) {
/* content */
echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view(ot_settings_id() . '[contextual_help][content]', $count, $content) . '</li>';
/* increment content count */
$count++;
}
}
echo '</ul>';
echo '<a href="javascript:void(0);" class="option-tree-help-add option-tree-ui-button button hug-left">' . __('Add Contextual Help Content', 'option-tree') . '</a>';
echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
echo '</div>';
echo '</div>';
echo '</form>';
}
示例3: ot_loop_through_sub_settings
function ot_loop_through_sub_settings($name, $settings = array())
{
$content = '';
foreach ($settings as $key => $setting) {
$content .= '<li class="ui-state-default list-sub-setting">' . ot_settings_view($name, $key, $setting) . '</li>';
}
return $content;
}
示例4: rj_taxonomy_ot_metabox_callback
function rj_taxonomy_ot_metabox_callback()
{
global $blog_id;
echo '
<h2>Taxonomy Custom Fields UI</h2>
<form method="post" id="option-tree-settings-form">';
/* form nonce */
wp_nonce_field('rj_option_tree_settings_form', 'option_tree_settings_nonce');
/* format setting outer wrapper */
echo '<div class="format-setting type-textblock has-desc">';
/* get the saved settings */
$settings = get_option('rj_taxonomy_' . ot_settings_id());
/* wrap settings array */
echo '<div class="format-setting-inner">';
/* set count to zero */
$count = 0;
/* loop through each section and its settings */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_list" data-name="' . ot_settings_id() . '[settings]">';
if (isset($settings['sections'])) {
foreach ($settings['sections'] as $section) {
/* section */
echo '<li class="' . ($count == 0 ? 'ui-state-disabled' : 'ui-state-default') . ' list-section">' . ot_taxonomy_sections_view(ot_settings_id() . '[sections]', $count, $section) . '
</li>';
/* increment item count */
$count++;
/* settings in this section */
if (isset($settings['settings'])) {
foreach ($settings['settings'] as $setting) {
if (isset($setting['section']) && $setting['section'] == $section['id']) {
echo '<li class="ui-state-default list-setting">' . ot_settings_view(ot_settings_id() . '[settings]', $count, $setting) . '</li>';
/* increment item count */
$count++;
}
}
}
}
}
echo '</ul>';
/* buttons */
echo '<a href="javascript:void(0);" class="option-tree-section-add option-tree-ui-button button hug-left">' . __('Add Section', 'option-tree') . '</a>';
echo '<a href="javascript:void(0);" class="option-tree-setting-add option-tree-ui-button button">' . __('Add Setting', 'option-tree') . '</a>';
echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
/* sidebar textarea */
echo '
<div class="format-setting-label" id="contextual-help-label">
<h3 class="label">' . __('Contextual Help', 'option-tree') . '</h3>
</div>
<div class="format-settings" id="contextual-help-setting">
<div class="format-setting type-textarea no-desc">
<div class="description"><strong>' . __('Contextual Help Sidebar', 'option-tree') . '</strong>: ' . __('If you decide to add contextual help to the Theme Option page, enter the optional "Sidebar" HTML here. This would be an extremely useful place to add links to your themes documentation or support forum. Only after you\'ve added some content below will this display to the user.', 'option-tree') . '</div>
<div class="format-setting-inner">
<textarea class="textarea" rows="10" cols="40" name="' . ot_settings_id() . '[contextual_help][sidebar]">' . (isset($settings['contextual_help']['sidebar']) ? esc_html($settings['contextual_help']['sidebar']) : '') . '</textarea>
</div>
</div>
</div>';
/* set count to zero */
$count = 0;
/* loop through each contextual_help content section */
echo '<ul class="option-tree-setting-wrap option-tree-sortable" id="option_tree_settings_help" data-name="' . ot_settings_id() . '[contextual_help][content]">';
if (isset($settings['contextual_help']['content'])) {
foreach ($settings['contextual_help']['content'] as $content) {
/* content */
echo '<li class="ui-state-default list-contextual-help">' . ot_contextual_help_view(ot_settings_id() . '[contextual_help][content]', $count, $content) . '</li>';
/* increment content count */
$count++;
}
}
echo '</ul>';
echo '<a href="javascript:void(0);" class="option-tree-help-add option-tree-ui-button button hug-left">' . __('Add Contextual Help Content', 'option-tree') . '</a>';
echo '<button class="option-tree-ui-button button button-primary right hug-right">' . __('Save Changes', 'option-tree') . '</button>';
echo '</div>';
echo '</div>';
echo '</form>';
?>
<form name="seamless-donations-form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<div class="seamless-donations-forms-error-message" style="display:none"></div>
<div id="dgx-donate-container">
<div id="dgx-donate-form-donation-section" class="dgx-donate-form-section">
<div id="donation_header">
<div id="donation_header-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
<h2>Donation Information</h2>
</div>
<div id="header_desc">
<div id="header_desc-error-message" style="display:none" class="seamless-donations-error-message-field"></div>
<p>I would like to make a donation in the amount of:</p>
//.........这里部分代码省略.........