/** * 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 cmb_metabox_form(self::option_fields(), $this->key); ?> </div> <?php }
/** * Shortcode to display a CMB form for a post ID. */ public function do_frontend_form() { // Default metabox ID $metabox_id = 'memorials_metabox'; // Get all metaboxes $meta_boxes = apply_filters('cmb_meta_boxes', array()); // If the metabox specified doesn't exist, yell about it. if (!isset($meta_boxes[$metabox_id])) { return __("A metabox with the specified 'metabox_id' doesn't exist.", 'cmb'); } // This is the WordPress post ID where the data should be stored/displayed. $post_id = 0; if ($new_id = $this->intercept_post_id()) { $post_id = $new_id; echo 'Thank You for your submission.'; } // Shortcodes need to return their data, not echo it. $echo = false; // Get our form $form = cmb_metabox_form($meta_boxes[$metabox_id], $post_id, $echo); return $form; }
* @author Devin Walker <*****@*****.**> * @license GPL-2.0+ * @link http://wordimpress.com * @copyright 2014 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('The following settings allow you to customize how Google Maps Builder functions within WordPress.', $this->plugin_slug); ?> </p> <?php cmb_metabox_form($this->general_option_fields(), self::$key); ?> </div> <div class="col-md-2"> </div> </div> </div>
?> </h2> <?php echo JM_TC_Tabs::admin_tabs(); ?> <?php /** * Fields for admin page multi-options * @return array */ function jm_tc_multi_author_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_multi_author')), 'show_names' => true, 'fields' => array(array('name' => __('Add a field in profiles for author', JM_TC_TEXTDOMAIN), 'desc' => __('This would add a field in profiles if user can publish posts. In this case his Twitter username will be set as meta creator.', JM_TC_TEXTDOMAIN), 'id' => 'twitterProfile', 'type' => 'select', 'options' => array('no' => __('No', JM_TC_TEXTDOMAIN), 'yes' => __('Yes', JM_TC_TEXTDOMAIN))), array('name' => __('Meta key Twitter', JM_TC_TEXTDOMAIN), 'desc' => __('If the above option is set to "no", just modify user meta key associated with Twitter Account in profiles to get Twitter usernames from your own fields:', JM_TC_TEXTDOMAIN), 'id' => 'twitterUsernameKey', 'type' => 'text_medium'))); return $plugin_options; } ?> <?php cmb_metabox_form(jm_tc_multi_author_options(), JM_TC_Admin::key()); ?> <div class="doc-valid"> <?php echo JM_TC_Admin::docu_links(0); ?> </div> </div>
?> </h2> <?php echo JM_TC_Tabs::admin_tabs(); ?> <?php /** * Fields for admin page robots * @return array */ function jm_tc_robots_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_robots')), 'show_names' => true, 'fields' => array(array('name' => __('Twitter\'s bot', JM_TC_TEXTDOMAIN), 'desc' => __('Add required rules in robots.txt', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardRobotsTxt', 'type' => 'select', 'options' => array('yes' => __('Yes', JM_TC_TEXTDOMAIN), 'no' => __('No', JM_TC_TEXTDOMAIN))))); return $plugin_options; } ?> <?php cmb_metabox_form(jm_tc_robots_options(), JM_TC_Admin::key()); ?> <div class="doc-valid"> <?php echo JM_TC_Admin::docu_links(7); ?> </div> </div>
?> </h2> <?php echo JM_TC_Tabs::admin_tabs(); ?> <?php /** * Fields for admin page home (page for posts/front page) * @return array */ function jm_tc_home_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_home')), 'show_names' => true, 'fields' => array(array('name' => __('Home meta desc', JM_TC_TEXTDOMAIN), 'desc' => __('Enter desc for Posts Page (max: 200 characters)', JM_TC_TEXTDOMAIN), 'id' => 'twitterPostPageDesc', 'type' => 'textarea_small'))); return $plugin_options; } ?> <?php cmb_metabox_form(jm_tc_home_options(), JM_TC_Admin::key()); ?> <div class="doc-valid"> <?php echo JM_TC_Admin::docu_links(2); ?> </div> </div>
header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } ?> <div class="wrap"> <h1 class="page-title-action">JM Twitter Cards : <?php echo esc_html(get_admin_page_title()); ?> </h1> <?php echo Tabs::admin_tabs(); ?> <?php /** * Fields for admin page deep linking * @return array */ function jm_tc_deep_linking_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_deep_linking')), 'show_names' => true, 'fields' => array(array('name' => __('Deep linking? ', JM_TC_TEXTDOMAIN), 'desc' => __('For all the following fields, if you do not want to use leave it blank but be careful with the required markup for your app. Read the documentation please.', JM_TC_TEXTDOMAIN), 'id' => 'deep_linking_title', 'type' => 'title'), array('name' => __('iPhone Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneName', 'type' => 'text_medium'), array('name' => __(' iPhone URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneUrl', 'type' => 'text_medium'), array('name' => __('iPhone ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneId', 'type' => 'text_medium'), array('name' => __('iPad Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadName', 'type' => 'text_medium'), array('name' => __('iPad URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadUrl', 'type' => 'text_medium'), array('name' => __('iPad ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadId', 'type' => 'text_medium'), array('name' => __('Google Play Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayName', 'type' => 'text_medium'), array('name' => __('Google Play URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayUrl', 'type' => 'text_medium'), array('name' => __('Google Play ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayId', 'type' => 'text_medium'), array('name' => __('App Country code', JM_TC_TEXTDOMAIN), 'desc' => __('Enter 2 letter App Country code in case your app is not available in the US app store', JM_TC_TEXTDOMAIN), 'id' => 'twitterAppCountry', 'type' => 'text_medium'))); return $plugin_options; } cmb_metabox_form(jm_tc_deep_linking_options(), Main::key()); ?> </div> <?php
header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } ?> <div class="wrap"> <h1 class="page-title-action">JM Twitter Cards : <?php echo esc_html(get_admin_page_title()); ?> </h1> <?php echo Tabs::admin_tabs(); ?> <?php /** * Fields for admin page custom fields * @return array */ function jm_tc_seo_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_cf')), 'show_names' => true, 'fields' => array(array('name' => __('Custom field title', JM_TC_TEXTDOMAIN), 'desc' => __('If you prefer to use your own field for twitter meta title instead of SEO plugin. Leave it blank if you want to use SEO plugin or default title.', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardTitle', 'type' => 'text_medium'), array('name' => __('Custom field desc', JM_TC_TEXTDOMAIN), 'desc' => __('If you prefer to use your own field for twitter meta description instead of SEO plugin. Leave it blank if you want to use SEO plugin or default desc.', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardDesc', 'type' => 'text_medium'))); return $plugin_options; } cmb_metabox_form(jm_tc_seo_options(), Main::key()); ?> </div> <?php
* @author Devin Walker <*****@*****.**> * @license GPL-2.0+ * @link http://wordimpress.com * @copyright 2014 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 cmb_metabox_form($this->map_option_fields(), self::$key); ?> </div> <div class="col-md-2"> </div> </div> </div>
header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } ?> <div class="wrap"> <h1 class="page-title-action">JM Twitter Cards : <?php echo esc_html(get_admin_page_title()); ?> </h1> <?php echo Tabs::admin_tabs(); ?> <?php /** * Fields for admin page images * @return array */ function jm_tc_image_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_images')), 'show_names' => true, 'fields' => array(array('name' => __('Image Fallback', JM_TC_TEXTDOMAIN), 'id' => 'twitterImage', 'type' => 'file'), array('name' => __('Image width', JM_TC_TEXTDOMAIN), 'desc' => __('px', JM_TC_TEXTDOMAIN), 'id' => 'twitterImageWidth', 'type' => 'text_number', 'min' => 280, 'max' => 1000), array('name' => __('Image height', JM_TC_TEXTDOMAIN), 'desc' => __('px', JM_TC_TEXTDOMAIN), 'id' => 'twitterImageHeight', 'type' => 'text_number', 'min' => 150, 'max' => 1000), array('name' => __('Crop', JM_TC_TEXTDOMAIN), 'desc' => __('Do you want to force crop on card Image?', JM_TC_TEXTDOMAIN) . __(' (Super Crop => WordPress 3.9++)', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardCrop', 'type' => 'select', 'options' => array('no' => __('No', JM_TC_TEXTDOMAIN), 'yes' => __('Yes', JM_TC_TEXTDOMAIN), 'yo' => __('Yes', JM_TC_TEXTDOMAIN) . ' (Super Crop)')), array('name' => __('Crop x', JM_TC_TEXTDOMAIN), 'desc' => __(' (Super Crop => WordPress 3.9++)', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardCropX', 'type' => 'select', 'options' => array('left' => __('Left', JM_TC_TEXTDOMAIN), 'center' => __('Center', JM_TC_TEXTDOMAIN), 'right' => __('Right', JM_TC_TEXTDOMAIN))), array('name' => __('Crop y', JM_TC_TEXTDOMAIN), 'desc' => __(' (Super Crop => WordPress 3.9++)', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardCropY', 'type' => 'select', 'options' => array('top' => __('Top', JM_TC_TEXTDOMAIN), 'center' => __('Center', JM_TC_TEXTDOMAIN), 'bottom' => __('Bottom', JM_TC_TEXTDOMAIN))), array('name' => __('Define specific size for twitter:image display', JM_TC_TEXTDOMAIN), 'id' => 'twitterCardImgSize', 'type' => 'select', 'options' => array('small' => __('280 x 375 px', JM_TC_TEXTDOMAIN), 'web' => __('560 x 750 px', JM_TC_TEXTDOMAIN), 'mobile-non-retina' => __('435 x 375 px', JM_TC_TEXTDOMAIN), 'mobile-retina' => __('280 x 150 px', JM_TC_TEXTDOMAIN))))); return $plugin_options; } cmb_metabox_form(jm_tc_image_options(), Main::key()); ?> </div> <?php
header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit; } ?> <div class="wrap"> <h1 class="page-title-action">JM Twitter Cards : <?php echo esc_html(get_admin_page_title()); ?> </h1> <?php echo Tabs::admin_tabs(); ?> <?php /** * Fields for admin page multi-options * @return array */ function jm_tc_multi_author_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_multi_author')), 'show_names' => true, 'fields' => array(array('name' => __('Add a field in profiles for author', JM_TC_TEXTDOMAIN), 'desc' => __('This would add a field in profiles if user can publish posts. In this case his Twitter username will be set as meta creator.', JM_TC_TEXTDOMAIN), 'id' => 'twitterProfile', 'type' => 'select', 'options' => array('no' => __('No', JM_TC_TEXTDOMAIN), 'yes' => __('Yes', JM_TC_TEXTDOMAIN))), array('name' => __('Meta key Twitter', JM_TC_TEXTDOMAIN), 'desc' => __('If the above option is set to "no", just modify user meta key associated with Twitter Account in profiles to get Twitter usernames from your own fields:', JM_TC_TEXTDOMAIN), 'id' => 'twitterUsernameKey', 'type' => 'text_medium'))); return $plugin_options; } cmb_metabox_form(jm_tc_multi_author_options(), Main::key()); ?> </div> <?php
public function admin_page_display() { ?> <div class="wrap awesome_responsive_menu_page <?php echo $this->key; ?> "> <h2><?php echo esc_html(get_admin_page_title()); ?> </h2> <?php cmb_metabox_form($this->option_metabox(), $this->key); ?> </div> <?php }
?> </h2> <?php echo JM_TC_Tabs::admin_tabs(); ?> <?php /** * Fields for admin page deep linking * @return array */ function jm_tc_deep_linking_options() { $plugin_options = array('id' => 'jm_tc', 'show_on' => array('key' => 'options-page', 'value' => array('jm_tc_deep_linking')), 'show_names' => true, 'fields' => array(array('name' => __('Deep linking? ', JM_TC_TEXTDOMAIN), 'desc' => __('For all the following fields, if you do not want to use leave it blank but be careful with the required markup for your app. Read the documentation please.', JM_TC_TEXTDOMAIN), 'id' => 'deep_linking_title', 'type' => 'title'), array('name' => __('iPhone Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneName', 'type' => 'text_medium'), array('name' => __(' iPhone URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneUrl', 'type' => 'text_medium'), array('name' => __('iPhone ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPhone ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPhoneId', 'type' => 'text_medium'), array('name' => __('iPad Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadName', 'type' => 'text_medium'), array('name' => __('iPad URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadUrl', 'type' => 'text_medium'), array('name' => __('iPad ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter iPad ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitteriPadId', 'type' => 'text_medium'), array('name' => __('Google Play Name', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play Name ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayName', 'type' => 'text_medium'), array('name' => __('Google Play URL', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play URL ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayUrl', 'type' => 'text_medium'), array('name' => __('Google Play ID', JM_TC_TEXTDOMAIN), 'desc' => __('Enter Google Play ID ', JM_TC_TEXTDOMAIN), 'id' => 'twitterGooglePlayId', 'type' => 'text_medium'), array('name' => __('App Country code', JM_TC_TEXTDOMAIN), 'desc' => __('Enter 2 letter App Country code in case your app is not available in the US app store', JM_TC_TEXTDOMAIN), 'id' => 'twitterAppCountry', 'type' => 'text_medium'))); return $plugin_options; } ?> <?php cmb_metabox_form(jm_tc_deep_linking_options(), JM_TC_Admin::key()); ?> <div class="doc-valid"> <?php echo JM_TC_Admin::docu_links(5); ?> </div> </div>