コード例 #1
0
    /**
     * 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
0
    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
0
ファイル: admin.php プロジェクト: CodeAtCode/Glossary
$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
0
 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
0
ファイル: options.php プロジェクト: shankarnakai/gbdesign
<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
0
ファイル: admin.php プロジェクト: ryanshoover/network-uploads
    /**
     * 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
0
    /**
     * 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 
    }
<?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')));
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');
}
コード例 #10
0
 /**
  * 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
0
?>
          <?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
0
    /**
     * 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
0
 * @author    Devin Walker <*****@*****.**>
 * @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
0
?>
          <?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('mixture_data', $post->ID);
        ?>
            </article>
          <?php 
    }
    // end loop
    ?>
          <?php 
}
?>

        </div><!-- end .main-content -->

        <?php 
get_sidebar();
?>
コード例 #15
0
ファイル: page.php プロジェクト: petermac-/WP-Gistpen
?>

<?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 ]
コード例 #16
0
 /**
  * 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>';
 }
コード例 #17
0
ファイル: admin.php プロジェクト: seanndlovu/kutetheme-wp
    /**
     * Admin page markup. Mostly handled by CMB2
     * @since  0.1.0
     */
    public function admin_page_display()
    {
        $link = $this->page_link();
        $boxes = $this->get_option_boxes();
        $config = $this->config;
        $wrap = isset($_GET['wrap']) ? sanitize_key($_GET['wrap']) : key($config);
        if (!isset($config[$wrap])) {
            reset($config);
            $wrap = key($config);
        }
        if (isset($config[$wrap]['cmb'])) {
            //Has child
            $tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : key($config[$wrap]['cmb']);
            if (!isset($config[$wrap]['cmb'][$tab])) {
                reset($boxes);
                $tab = key($config[$wrap]['cmb']);
            }
        } else {
            $tab = $wrap;
        }
        ?>
        <div class="container-option">
            <div class="wrapper cmb2-options-page <?php 
        echo esc_attr($this->key);
        ?>
 <?php 
        echo esc_attr($tab);
        ?>
 <?php 
        echo esc_attr($wrap);
        ?>
">
                <h2><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>
                <div class="kt-box-menu">
                    <div class="kt_sidebar">
                        <ul class="kt_group_menu">
                            <?php 
        foreach ($config as $k => $c) {
            ?>
                                <?php 
            if (isset($c['type']) && $c['type'] == 'wrapper') {
                ?>
                                    <li class="kt_item_menu has_child <?php 
                echo $wrap == $k ? 'menu-item-active show-submenu' : '';
                ?>
">
                                        <a href="<?php 
                echo add_query_arg(array('wrap' => esc_attr($k)), esc_url($link));
                ?>
"><?php 
                echo $c['title'];
                ?>
</a>
                                        <span class="arow"></span>
                                        <ul class="kt_menu">
                                            <?php 
                foreach ($c['cmb'] as $cmb) {
                    ?>
                                                 <li class="kt_item_menu kt_chil_item <?php 
                    echo $tab == $cmb['setting']['id'] ? 'active' : '';
                    ?>
"><a href="<?php 
                    echo add_query_arg(array('wrap' => esc_attr($k), 'tab' => esc_attr($cmb['setting']['id'])), esc_url($link));
                    ?>
"><?php 
                    echo esc_attr($cmb['setting']['title']);
                    ?>
</a></li>
                                            <?php 
                }
                ?>
                                        </ul>
                                    </li>
                                <?php 
            } else {
                //Single
                ?>
                                    <li class="kt_item_menu only_item <?php 
                echo $wrap == $k ? 'menu-item-active' : '';
                ?>
">
                                        <a href="<?php 
                echo add_query_arg(array('wrap' => esc_attr($k)), esc_url($link));
                ?>
"><?php 
                echo $c['setting']['title'];
                ?>
</a>
                                    </li>
                                <?php 
            }
            ?>
                            <?php 
        }
        ?>
                        </ul>
                    </div>
                    <div class="content-page-option">
                        <div class="content-tab">
                            <?php 
        if (isset($config[$wrap]['cmb']) && count($config[$wrap]['cmb']) > 1) {
            ?>
                                <h2 class="nav-tab-wrapper">
                                    <?php 
            foreach ($config[$wrap]['cmb'] as $k => $t) {
                ?>
                                        <a href="<?php 
                echo add_query_arg(array('wrap' => esc_attr($wrap), 'tab' => esc_attr($k)), esc_url($link));
                ?>
" class="nav-tab <?php 
                echo $tab == $k ? 'nav-tab-active' : '';
                ?>
"><?php 
                echo esc_html($t['setting']['title']);
                ?>
</a>
                                    <?php 
            }
            ?>
                                </h2>
                            <?php 
        }
        ?>
                            <?php 
        cmb2_metabox_form($tab, $this->key, array('cmb_styles' => false));
        ?>
                        </div>
                        <div class="bg-color-menu"></div>
                    </div>
                </div><!--kt-box-menu-->
            </div>
        </div>
    <?php 
    }
コード例 #18
0
ファイル: cw-quicklinks.php プロジェクト: jbeyta/joelandsam
    /**
     * Admin page markup. Mostly handled by CMB
     * @since  0.1.0
     */
    public function admin_page_display()
    {
        ?>
	<div class="wrap cmb_options_page <?php 
        echo $this->key;
        ?>
">
		<h2><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>
		<?php 
        cmb2_metabox_form(self::option_fields(), $this->key);
        ?>
	</div>
	<?php 
    }
コード例 #19
0
 * @link      http://wordimpress.com
 * @copyright 2016 WordImpress
 */
?>

<div class="container">
	<div class="row">

		<div class="col-md-10">

			<h3>
				<?php 
_e('Default Map Settings', 'google-maps-builder');
?>
			</h3>
			<p>
				<?php 
_e('The following settings change the default map options that display when created a new map.', 'google-maps-builder');
?>
			</p>
			<?php 
cmb2_metabox_form($map_option_fields, $key);
?>
		</div>

		<div class="col-md-2">

		</div>
	</div>
</div>
コード例 #20
0
    /**
     * 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;
        ?>
">
			<div id="poststuff"> 
	            <div id="post-body" class="metabox-holder columns-<?php 
        echo 1 == get_current_screen()->get_columns() ? '1' : '2';
        ?>
">	 
	                <div id="post-body-content">
						<h2><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>
						<?php 
        cmb2_metabox_form($this->metabox_id, $this->key, array('cmb_styles' => false));
        ?>
					</div>
					<div id="postbox-container-1" class="postbox-container">
					    <?php 
        do_meta_boxes('', 'side', null);
        ?>
					</div>
				</div>
			</div>
			
		</div>
		
		<?php 
    }
コード例 #21
0
ファイル: admin.php プロジェクト: CodeAtCode/hook-flowchart
<?php

/**
 * Represents the view for the administration dashboard.
 *
 * This includes the header, options, and other information that should provide
 * The User Interface to the end user.
 *
 * @package   Hook_Flowchart
 * @author    Mte90 <*****@*****.**>
 * @license   GPL-2.0+
 * @link      http://codeat.it
 * @copyright 2015 GPL
 */
?>

<div class="wrap">
    <h2>Hook Flowchart</h2>
    <?php 
$cmb = new_cmb2_box(array('id' => 'options', 'hookup' => false, 'show_on' => array('key' => 'options-page', 'value' => array($this->plugin_slug)), 'show_names' => true));
$cmb->add_field(array('name' => __('Exclude Parent Hook', $this->plugin_slug), 'desc' => __('Separate with a comma', $this->plugin_slug), 'id' => 'excluded', 'type' => 'textarea'));
cmb2_metabox_form('options', $this->plugin_slug);
?>
</div>
</div>
コード例 #22
0
    /**
     * Renders the settings page
     *
     * @author caseypatrickdriscoll
     */
    static function render()
    {
        ?>
		<h2><?php 
        _e(self::$title);
        ?>
</h2>
		<div class="wrap cmb2-options-page">
			<?php 
        cmb2_metabox_form(self::$key, self::$key);
        ?>
		</div>
		<?php 
    }
コード例 #23
0
 * @author    Devin Walker <*****@*****.**>
 * @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('Default Map Settings', $this->plugin_slug);
?>
</h3>
			<p><?php 
_e('The following settings change the default map options that display when created a new map.', $this->plugin_slug);
?>
</p>
			<?php 
cmb2_metabox_form($this->map_option_fields(), self::$key);
?>
		</div>

		<div class="col-md-2">

		</div>
	</div>
</div>
コード例 #24
0
        /**
         * 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));
            ?>
		<style type="text/css" media="screen">
		.cmb-form {
			padding-left: 6px;
			padding-right: 6px;
		}
		.ui-dialog .cmb-th {
			width: 100%;
		}
		.ui-dialog .cmb-th,
		.ui-dialog .cmb2-metabox > .cmb-row:first-of-type > .cmb-th,
		.ui-dialog .cmb2-metabox .cmb-field-list > .cmb-row:first-of-type > .cmb-th {
			padding: 1em 0 0 1px;
		}
		.ui-dialog .cmb-td {
			padding: .2em 0 0;
		}
		.ui-dialog .cmb-type-checkbox .cmb-td {
			padding: 1.2em 0 0 0;
		}
		.ui-dialog .cmb-type-checkbox .cmb-th {
			width: 300px;
		}
		.ui-dialog .cmb-th + .cmb-td {
			float: none;
		}
		</style>
		<?php 
        }
コード例 #25
0
$cmb->add_field(array('name' => __('Test wysiwyg', $this->plugin_slug), 'desc' => __('field description (optional)', $this->plugin_slug), 'id' => $this->plugin_slug . '_wysiwyg', 'type' => 'wysiwyg', 'options' => array('textarea_rows' => 5)));
$cmb->add_field(array('name' => __('Test Image', $this->plugin_slug), 'desc' => __('Upload an image or enter a URL.', $this->plugin_slug), 'id' => $this->plugin_slug . '_image', 'type' => 'file'));
$cmb->add_field(array('name' => __('Multiple Files', $this->plugin_slug), 'desc' => __('Upload or add multiple images/attachments.', $this->plugin_slug), 'id' => $this->plugin_slug . '_file_list', 'type' => 'file_list', 'preview_size' => array(100, 100)));
$cmb->add_field(array('name' => __('oEmbed', $this->plugin_slug), 'desc' => __('Enter a youtube, twitter, or instagram URL. Supports services listed at <a href="http://codex.wordpress.org/Embeds">http://codex.wordpress.org/Embeds</a>.', $this->plugin_slug), 'id' => $this->plugin_slug . '_embed', 'type' => 'oembed'));
$cmb->add_field(array('name' => 'Testing Field Parameters', 'id' => $this->plugin_slug . '_parameters', 'type' => 'text', 'before_row' => '<p>before_row_if_2</p>', 'before' => '<p>Testing <b>"before"</b> parameter</p>', 'before_field' => '<p>Testing <b>"before_field"</b> parameter</p>', 'after_field' => '<p>Testing <b>"after_field"</b> parameter</p>', 'after' => '<p>Testing <b>"after"</b> parameter</p>', 'after_row' => '<p>Testing <b>"after_row"</b> parameter</p>'));
cmb2_metabox_form($this->plugin_slug . '_options', $this->plugin_slug . '-settings');
?>

			<!-- @TODO: Provide other markup for your options page here. -->
		</div>
		<div id="tabs-2" class="wrap">
			<?php 
$cmb = new_cmb2_box(array('id' => $this->plugin_slug . '_options-second', 'hookup' => false, 'show_on' => array('key' => 'options-page', 'value' => array($this->plugin_slug)), 'show_names' => true));
$cmb->add_field(array('name' => __('Text', $this->plugin_slug), 'desc' => __('field description (optional)', $this->plugin_slug), 'id' => $this->plugin_slug . '_text-second', 'type' => 'text', 'default' => 'Default Text'));
$cmb->add_field(array('name' => __('Color Picker', $this->plugin_slug), 'desc' => __('field description (optional)', $this->plugin_slug), 'id' => $this->plugin_slug . '_colorpicker-second', 'type' => 'colorpicker', 'default' => '#bada55'));
cmb2_metabox_form($this->plugin_slug . '_options-second', $this->plugin_slug . '-settings-second');
?>

			<!-- @TODO: Provide other markup for your options page here. -->
		</div>
		<div id="tabs-3" class="metabox-holder">
			<div class="postbox">
				<h3 class="hndle"><span><?php 
_e('Export Settings', $this->plugin_slug);
?>
</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.', $this->plugin_slug);
?>
</p>
コード例 #26
0
<?php

/**
 * To change the formatting of the form,
 * again, pass the third parameter (the arguments array),
 * and specify the 'form_format' param
 *
 * In our case, we're modifying the save button text,
 * and we're giving the save button a secondary button class
 */
cmb2_metabox_form($meta_box, $object_id, array('form_format' => '<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<div class="submit-wrap"><input type="submit" name="submit-cmb" value="' . __('Save Settings', 'your-textdomain') . '" class="button-secondary"></div></form>'));
コード例 #27
0
ファイル: admin.php プロジェクト: ngocthangict/kutetheme-wp
    /**
     * Admin page markup. Mostly handled by CMB2
     * @since  0.1.0
     */
    public function admin_page_display()
    {
        $link = $this->page_link();
        $boxes = $this->get_option_boxes();
        $tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : key($boxes);
        if (!isset($boxes[$tab])) {
            reset($boxes);
            $tab = key($boxes);
        }
        ?>
        <div class="wrap cmb2-options-page <?php 
        echo $this->key;
        ?>
 <?php 
        echo esc_attr($tab);
        ?>
">
            <h2><?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>
            <?php 
        if (count($boxes) > 1) {
            ?>
            <h2 class="nav-tab-wrapper">
                <?php 
            foreach ($boxes as $k => $mb) {
                ?>
                <a href="<?php 
                echo add_query_arg(array('tab' => $k), $link);
                ?>
" class="nav-tab <?php 
                echo $tab == $k ? 'nav-tab-active' : '';
                ?>
"><?php 
                echo $mb->meta_box['title'];
                ?>
</a>
                <?php 
            }
            ?>
            </h2>
            <?php 
        }
        ?>
            <?php 
        cmb2_metabox_form($tab, $this->key, array('cmb_styles' => false));
        ?>
        </div>
    <?php 
    }
コード例 #28
0
    /**
     * Admin page markup. Mostly handled by CMB2
     *
     * @since  0.1.0
     * @return void
     */
    public function admin_page_display()
    {
        $args = array();
        if ($this->get('api_url') && !$this->get('consumer_key')) {
            $args['save_button'] = __('Begin Authorization', 'wds-rest-connect-ui');
        }
        ?>
		<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, $args);
        ?>
		</div>
		<?php 
        if ($this->api()->connected()) {
            $creds = $this->api()->get_option('token_credentials');
            $auth_urls = $this->api()->auth_urls;
            ?>
			<br>
			<h3 style="color:green">Connected!</h3>
			<hr>
			<div class="extra-detail">
				<h3>OAuth endpoints</h3>
				<dl>
					<dt>Request Token Endpoint</dt>
					<dd><code><?php 
            echo esc_attr($auth_urls->request);
            ?>
</code></dd>
					<dt>Authorize Endpoint</dt>
					<dd><code><?php 
            echo esc_attr($auth_urls->authorize);
            ?>
</code></dd>
					<dt>Access Token Endpoint</dt>
					<dd><code><?php 
            echo esc_attr($auth_urls->access);
            ?>
</code></dd>
				</dl>
				<h3>OAuth credentials</h3>
				<dl>
					<dt>Client Key</dt>
					<dd><code><?php 
            echo esc_attr($this->api()->client_key);
            ?>
</code></dd>
					<dt>Client Secret</dt>
					<dd><code><?php 
            echo esc_attr($this->api()->client_secret);
            ?>
</code></dd>
					<dt>Access Token</dt>
					<dd><code><?php 
            echo esc_attr($creds->getIdentifier());
            ?>
</code></dd>
					<dt>Access Token Secret</dt>
					<dd><code><?php 
            echo esc_attr($creds->getSecret());
            ?>
</code></dd>
				</dl>
			</div>
		<?php 
        }
    }
コード例 #29
0
        /**
         * Plugin settings page call back.
         *
         * @since  0.0.1
         */
        public function settings_page()
        {
            ?>
			<div class="wrap cmb2-options-page <?php 
            echo esc_attr($this->settings_key);
            ?>
">
				<h2><?php 
            echo esc_html__('CMB2 Settings', 'cmb2-admin-extension');
            ?>
</h2>
				<?php 
            cmb2_metabox_form($this->settings_metabox_id, $this->settings_key, array('disable_styles' => false));
            ?>
			</div>
			<?php 
        }
コード例 #30
0
    /**
     * Admin page markup. Mostly handled by CMB
     */
    public function admin_page_display()
    {
        $option_tabs = self::option_fields();
        $tab_forms = [];
        ?>
		<div class="wrap cmb_options_page <?php 
        echo $this->key;
        ?>
">
			<h2><i class="fa fa-globe"></i> <?php 
        echo esc_html(get_admin_page_title());
        ?>
</h2>

			<h2 class="nav-tab-wrapper">
				<?php 
        foreach ($option_tabs as $option_tab) {
            $tab_slug = $option_tab['id'];
            $nav_class = 'nav-tab';
            if ($tab_slug == $_GET['page']) {
                $nav_class .= ' nav-tab-active';
                $tab_forms[] = $option_tab;
            }
            ?>
					<a class="<?php 
            echo $nav_class;
            ?>
"
					   href="<?php 
            menu_page_url($tab_slug);
            ?>
"><?php 
            esc_attr_e($option_tab['title']);
            ?>
</a>
				<?php 
        }
        ?>
			</h2>


			<?php 
        foreach ($tab_forms as $tab_form) {
            //render all tab forms (normaly just 1 form)
            ?>
				<div id="<?php 
            esc_attr_e($tab_form['id']);
            ?>
" class="group">
					<?php 
            cmb2_metabox_form($tab_form, $tab_form['id']);
            ?>
				</div>
			<?php 
        }
        ?>
		</div>
		<?php 
    }