本文整理汇总了PHP中cmb2_metabox_form函数的典型用法代码示例。如果您正苦于以下问题:PHP cmb2_metabox_form函数的具体用法?PHP cmb2_metabox_form怎么用?PHP cmb2_metabox_form使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cmb2_metabox_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_page_display
/**
* Admin page markup. Mostly handled by CMB2
* @since 0.1.0
*/
public function admin_page_display()
{
?>
<div class="wrap cmb2-options-page <?php
echo $this->key;
?>
">
<h2><?php
echo esc_html(get_admin_page_title());
?>
</h2>
<?php
cmb2_metabox_form($this->metabox_id, $this->key);
?>
</div>
<?php
}
示例2: admin_page_display
public function admin_page_display()
{
?>
<div class='wrap cmb2-options-page <?php
echo $this->key;
?>
'>
<h2> <?php
//esc_html( get_admin_page_title() )
?>
</h2>
<?php
cmb2_metabox_form($this->metabox_id, $this->key);
?>
<?php
// add a hook for debug feedback.
?>
<?php
do_action('admin_page_display_debug_' . $this->key);
?>
</div>
<?php
}
示例3: __
$cmb->add_field(array('name' => __('Glossary Terms Slug', GT_TEXTDOMAIN), 'id' => 'slug', 'type' => 'text_small', 'default' => 'glossary'));
$cmb->add_field(array('name' => __('Glossary Category Slug', GT_TEXTDOMAIN), 'id' => 'slug-cat', 'type' => 'text_small', 'default' => 'glossary-cat'));
$cmb->add_field(array('name' => __('Disable Archive in the frontend for Glossary Terms', GT_TEXTDOMAIN), 'desc' => __('Don\'t forget to flush the permalinks', GT_TEXTDOMAIN), 'id' => 'archive', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Disable Archive in the frontend for Glossary Taxonomy', GT_TEXTDOMAIN), 'id' => 'tax_archive', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Behaviour', GT_TEXTDOMAIN), 'id' => 'title_behaviour', 'type' => 'title'));
$cmb->add_field(array('name' => __('Link only the first occurence', GT_TEXTDOMAIN), 'desc' => __('Prevent duplicate links and tooltips in the same post', GT_TEXTDOMAIN), 'id' => 'first_occurence', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Replace search result with Glossary Terms', GT_TEXTDOMAIN), 'desc' => __('Add the post type to the others, in few case only this post type is enabled', GT_TEXTDOMAIN), 'id' => 'search', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Tooltip', GT_TEXTDOMAIN), 'id' => 'title_tooltip', 'type' => 'title'));
$cmb->add_field(array('name' => __('Enable tooltips on terms', GT_TEXTDOMAIN), 'desc' => __('Tooltip will popup on hover', GT_TEXTDOMAIN), 'id' => 'tooltip', 'type' => 'checkbox'));
$themes = apply_filters('glossary-themes-dropdown', array('classic' => 'Classic', 'box' => 'Box', 'line' => 'Line'));
$cmb->add_field(array('name' => __('Tooltip style', GT_TEXTDOMAIN), 'desc' => __('Only classic shows featured images', GT_TEXTDOMAIN), 'id' => 'tooltip_style', 'type' => 'select', 'options' => $themes));
$cmb->add_field(array('name' => __('Enable image in tooltips', GT_TEXTDOMAIN), 'desc' => __('Check it if you want also term\'s featured image in classic tooltips', GT_TEXTDOMAIN), 'id' => 't_image', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Excerpt', GT_TEXTDOMAIN), 'id' => 'title_excerpt_limit', 'type' => 'title'));
$cmb->add_field(array('name' => __('Limit the excerpt by words', GT_TEXTDOMAIN), 'id' => 'excerpt_words', 'type' => 'checkbox'));
$cmb->add_field(array('name' => __('Excerpt length in char or words', GT_TEXTDOMAIN), 'desc' => __('This value is used for the option below', GT_TEXTDOMAIN), 'id' => 'excerpt_limit', 'type' => 'text_number', 'default' => '60'));
cmb2_metabox_form(GT_SETTINGS . '_options', GT_SETTINGS . '-settings');
?>
<!-- @TODO: Provide other markup for your options page here. -->
</div>
<div id="tabs-impexp" class="metabox-holder">
<div class="postbox">
<h3 class="hndle"><span><?php
_e('Export Settings', GT_TEXTDOMAIN);
?>
</span></h3>
<div class="inside">
<p><?php
_e('Export the plugin settings for this site as a .json file. This allows you to easily import the configuration into another site.', GT_TEXTDOMAIN);
?>
</p>
示例4: fdcEmailsPage
public function fdcEmailsPage()
{
echo '<div class="wrap">';
printf('<h1>%s</h1>', esc_attr__('Email settings', 'fdc'));
echo '<hr /><br />';
cmb2_metabox_form($this->to_client_metabox_id, $this->key);
echo '<hr class="divider" />';
cmb2_metabox_form($this->to_you_metabox_id, $this->key);
}
示例5: esc_html
<div class="wrap cmb2-options-page <?php
echo $key;
?>
">
<h2><?php
echo esc_html(get_admin_page_title());
?>
</h2>
<?php
cmb2_metabox_form($metabox_id, $key);
?>
</div>
示例6: admin_page_display
/**
* Admin page markup. Mostly handled by CMB2
* @since 0.1.0
*/
public function admin_page_display()
{
?>
<div class="wrap cmb2-options-page <?php
echo $this->options_slug;
?>
">
<h2><?php
echo esc_html(get_admin_page_title());
?>
</h2>
<?php
cmb2_metabox_form($this->options_slug . 'analytics', $this->options_slug, array('cmb_styles' => false));
?>
</div>
<?php
}
示例7: admin_page_display
/**
* Admin page markup. Mostly handled by CMB2
* @since 1.0
*/
public function admin_page_display()
{
$active_tab = isset($_GET['tab']) && array_key_exists($_GET['tab'], $this->give_get_settings_tabs()) ? $_GET['tab'] : 'general';
?>
<div class="wrap give_settings_page cmb2_options_page <?php
echo $this->key;
?>
">
<h2 class="nav-tab-wrapper">
<?php
foreach ($this->give_get_settings_tabs() as $tab_id => $tab_name) {
$tab_url = esc_url(add_query_arg(array('settings-updated' => false, 'tab' => $tab_id)));
$active = $active_tab == $tab_id ? ' nav-tab-active' : '';
echo '<a href="' . esc_url($tab_url) . '" title="' . esc_attr($tab_name) . '" class="nav-tab' . $active . '">';
echo esc_html($tab_name);
echo '</a>';
}
?>
</h2>
<?php
cmb2_metabox_form($this->give_settings($active_tab), $this->key);
?>
</div><!-- .wrap -->
<?php
}
示例8: cmb2_metabox_form
<?php
/**
* To change just the text of the save button,
* pass the third parameter (the arguments array),
* and specify the 'save_button' param
*/
cmb2_metabox_form($meta_box, $object_id, array('save_button' => __('Save Settings', 'your-textdomain')));
示例9: mbdbif_settings_page
function mbdbif_settings_page()
{
echo '<h1>' . __('Mooberry Book Manager Image Fixer', 'mooberry-book-manager-image-fixer') . '</h1>';
$metabox = apply_filters('mbdbif_settings_options_meta_box', array('id' => 'mbdbif_option_metabox', 'show_on' => array('key' => 'options-page', 'value' => 'mbdbif_options'), 'show_names' => true, 'fields' => array(array('id' => 'mbdbif_title', 'name' => '', 'type' => 'title', 'desc' => __('This will restore the original images that were included with Mooberry Book Manager. Images that were deleted will not be restored unless Restore is checked below.', 'mooberry-book-manager-image-fixer') . ' <br><br><b>' . __('Please be patient. The process can take a minute to run.', 'mooberry-book-manager-image-fixer') . '</b>'), array('id' => 'mbdbif_images_to_fix', 'name' => __('Fix these images', 'mooberry-book-manager-image-fixer'), 'type' => 'multicheck', 'options' => mbdbif_image_options()))));
cmb2_metabox_form($metabox, 'mbdbif_options');
}
开发者ID:christiespeich,项目名称:mooberry-book-manager-image-fixer,代码行数:6,代码来源:mooberry-book-manager-image-fixer.php
示例10: do_cmb_form
/**
* Use CMB2 cmb2_metabox_form to output form display
*
* Only applies if cmb_metabox_config parameter exists.
* CMB2 must be included prior to running this script.
*
* @since 0.1.0
*/
public function do_cmb_form()
{
if (!function_exists('cmb2_metabox_form')) {
return;
}
$form = '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s</form>';
cmb2_metabox_form($this->get_cmb_object(), $this->button_slug, array('form_format' => $form));
}
示例11: while
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<article>
<h1 class="page-title"><?php
the_title();
?>
</h1>
<?php
the_content();
?>
<?php
cmb2_metabox_form('resource_data', $post->ID);
?>
</article>
<?php
}
// end loop
?>
<?php
}
?>
</div><!-- end .main-content -->
<?php
get_sidebar();
?>
示例12: render_cat_options_page
/**
* Admin page markup. Mostly handled by CMB2
* @since 0.1.0
*/
public function render_cat_options_page()
{
?>
<div class="wrap cmb2-options-page <?php
echo $this->key;
?>
">
<?php
do_action('print_updated_settings_notice');
?>
<h2><?php
_e('Client and Product Testimonials Lite Settings', 'client-and-product-testimonials');
?>
</h2>
<?php
cmb2_metabox_form($this->metabox_id, $this->key, array('cmb_styles' => false));
?>
</div>
<?php
}
示例13: _e
* @author Devin Walker <devin@wordimpress.com>
* @license GPL-2.0+
* @link http://wordimpress.com
* @copyright 2015 WordImpress, Devin Walker
*/
?>
<div class="container">
<div class="row">
<div class="col-md-10">
<h3><?php
_e('General Settings', $this->plugin_slug);
?>
</h3>
<p><?php
_e('Customize how Google Maps Builder functions within WordPress.', $this->plugin_slug);
?>
</p>
<?php
cmb2_metabox_form($this->general_option_fields(), self::$key);
?>
</div>
<div class="col-md-2">
</div>
</div>
</div>
示例14: do_action
?>
<?php
do_action('wpgp_settings_before_title');
?>
<div class="wpgp-wrap">
<h2><?php
echo esc_html(get_admin_page_title());
?>
</h2>
<?php
$prefix = '_wpgp_';
cmb2_metabox_form(array('id' => 'wpgp_option_metabox', 'show_on' => array('key' => 'options-page', 'value' => array($this->plugin_name)), 'show_names' => true, 'fields' => array(array('name' => __('Add your GitHub token', $this->plugin_name), 'desc' => '<a href="https://github.com/settings/tokens/new">' . __('Create a GitHub token', $this->plugin_name) . '</a>', 'id' => $prefix . 'gist_token', 'type' => 'text'), array('name' => __('Highlighter Theme', $this->plugin_name), 'desc' => __('This is the theme PrismJS highlights your code with. See how it works below.', $this->plugin_name), 'id' => $prefix . 'gistpen_highlighter_theme', 'type' => 'select', 'options' => array('default' => __('Default', $this->plugin_name), 'dark' => __('Dark', $this->plugin_name), 'funky' => __('Funky', $this->plugin_name), 'okaidia' => __('Okaidia', $this->plugin_name), 'twilight' => __('Twilight', $this->plugin_name), 'coy' => __('Coy', $this->plugin_name))), array('name' => __('Enable line numbers', $this->plugin_name), 'id' => $prefix . 'gistpen_line_numbers', 'type' => 'checkbox'))), $this->plugin_name);
?>
<pre class="gistpen line-numbers"><code class="language-ruby"># Simple for loop using a range.
for i in (1..4)
print i," "
end
print "\n"
for i in (1...4)
print i," "
end
print "\n"
# Running through a list (which is what they do).
items = [ 'Mark', 12, 'goobers', 18.45 ]
示例15: admin_page_display
/**
* Admin page markup.
* @since 3.0
*/
public function admin_page_display()
{
// title
echo '<h2>' . esc_html(get_admin_page_title()) . '</h2>';
// instructions
do_action('mbdb_settings_before_instructions');
/*echo '<p>';
echo '<b>' . __('NOTE:', 'mooberry-book-manager') . '</b> ';
echo __('You must click the SAVE button to save your changes before switching tabs.', 'mooberry-book-manager');
echo '</p>';
*/
do_action('mbdb_settings_after_instructions');
// tabs
do_action('mbdb_settings_pre_tab_display', $this->tab);
//$this->tab_display();
do_action('mbdb_settings_post_tab_display', $this->tab);
// About Mooberry boxes
echo '<div id="mbdb_about_mooberry"><div class="mbdb_box"> <h3>' . __('Need help with Mooberry Book Manager?', 'mooberry-book-manager') . '</h3>';
include 'views/admin-about-mooberry.php';
echo '</div>';
include 'views/admin-about-mooberry-story.php';
echo '</div>';
// metabox
if ($this->tab == 'mbdb_migrate') {
$this->migrate_data();
return;
}
do_action('mbdb_settings_before_metabox', $this->tab, $this->metabox_id);
echo '<div class="wrap cmb2-options-page ' . $this->key . '">';
echo '<div id="icon-options-general" class="icon32"></div>';
cmb2_metabox_form($this->metabox_id, $this->key);
do_action('mbdb_settings_after_metabox', $this->tab, $this->metabox_id);
echo '</div>';
}