Ejemplo n.º 1
0
function retrieve_my_terms()
{
    if (is_admin()) {
        global $termeni;
        $termeni = get_terms('portfolio_cats', array('hide_empty' => false));
        global $catarray;
        $catarray = array();
        foreach ($termeni as $term) {
            $catarray[$term->term_id] = $term->name;
            if (function_exists('icl_register_string')) {
                icl_register_string('Portfolio Category', 'Term ' . $term->term_id . '', $term->name);
            }
        }
        //prefix
        $prefix = 'dt_';
        /*-----------------------------------------------------------------------------------*/
        /*	Pages Metaboxes
        /*-----------------------------------------------------------------------------------*/
        // Metaboxes for All Pages
        $config = array('id' => 'dt_page_options', 'title' => 'Page Options (optional)', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'default', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $page_options = new AT_Meta_Box($config);
        $page_options->addText($prefix . 'page_tagline', array('name' => 'Title Tagline', 'desc' => 'You can set a tagline for the title.'));
        $page_options->addCheckbox($prefix . 'page_title', array('name' => 'Disable Title Section', 'desc' => 'You can disable the entire page title section and use Visual Composer to build your page on a blank canvas.'));
        $page_options->Finish();
        //Portfolio Options Boxes
        $config = array('id' => 'dt_portfolio_options', 'title' => 'Portfolio Page Options', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $portfolio_options = new AT_Meta_Box($config);
        $portfolio_options->addImageRadio($prefix . 'portfolio_columns', array('grid' => 'Grid'), array('name' => 'Portfolio Layout', 'std' => array('grid')));
        $portfolio_options->addRadio($prefix . 'portfolio_navigation', array('filter' => 'With Filter', 'no-filter' => 'Without Filter'), array('name' => 'Portfolio Type', 'std' => array('filter')));
        $portfolio_options->addText($prefix . 'nav_number', array('name' => 'How many items would you like to display on this portfolio page? (working only if "Without Filter" option is selected.)', 'desc' => 'Please enter a number in the box (Default number is 8)', 'std' => '8'));
        $portfolio_options->addCheckboxList($prefix . 'cats_field', $catarray, array('name' => 'Portfolio Categories ', 'desc' => 'Set from which categories to display projects.'));
        $portfolio_options->Finish();
        // Metaboxes for Blog Page
        $config = array('id' => 'dt_blog_options', 'title' => 'Blog Layout Options', 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $blog_options = new AT_Meta_Box($config);
        $blog_options->addImageRadio($prefix . 'blog_layout', array('masonry-3-cols' => 'Masonry - 3 Columns', 'masonry-2-cols' => 'Masonry - 2 Columns', 'masonry-2-cols-sidebar-right' => 'Masonry - 2 Columns with Right Sidebar', 'masonry-2-cols-sidebar-left' => 'Masonry - 2 Columns with Left Sidebar', 'sidebar-right' => 'Right Sidebar', 'sidebar-left' => 'Left Sidebar', 'no-blog-sidebar' => 'No Sidebar'), array('name' => 'Blog Layout (regular or masonry layout)', 'std' => array('masonry-3-cols')));
        $blog_options->addInfo($prefix . 'info_blog_layout', array('name' => '', 'desc' => 'You can choose whether to use a masonry layout or the regular layout with left or right sidebar for the blog page. If you choose "Right Sidebar" or "Left Sidebar" option, make sure to set a sidebar too, from "Page Layout" metabox(top-right area of the screen). "Sidebar position" option is disabled for this page template.', 'std' => ''));
        $blog_options->addTaxonomy($prefix . 'blog_categories', array('taxonomy' => 'category', 'type' => 'checkbox_list'), array('name' => 'Display blog posts only from certain categories ', 'desc' => 'If you want to display blog posts only from certain categories, select them from the list. Choosing none will display posts from all of them.'));
        $blog_options->addText($prefix . 'posts_number', array('name' => 'How many items would you like to display on this blog page? ', 'desc' => 'Default: 10 blog posts', 'std' => '10'));
        $blog_options->Finish();
        // Metaboxes for Services Page
        $config = array('id' => 'dt_services_options', 'title' => 'Service Item Options', 'pages' => array('services'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        // Retrieve Fontawesome icons as an array, based on the minimized css file
        /*
          	$pattern = '/\.(fa-(?:\w+(?:-)?)+):before{content:"/';
        	
        	$request = new WP_Http;
        	$subject = $request->request( get_template_directory_uri() . '/framework/fonts/font-awesome/css/font-awesome.css' );				
        	
        	preg_match_all($pattern, $subject['body'], $matches, PREG_SET_ORDER);
        	$icons = array();
        	
        	if(!empty($subject['body'])) {
        foreach($matches as $match){
        	$icons[$match[1]] = $match[1];
        }
        
        foreach ($icons as $icon) {
        	// printf('"' .$icon.'" => "'. $icon .'" , ');
        	printf('"' .$icon.'" , ');
        
        }
        	}
        	/*
        	else { 
        */
        // local fallback
        // fontawesome 4.2.0
        $icons = array("fa-glass" => "fa-glass", "fa-music" => "fa-music", "fa-search" => "fa-search", "fa-envelope-o" => "fa-envelope-o", "fa-heart" => "fa-heart", "fa-star" => "fa-star", "fa-star-o" => "fa-star-o", "fa-user" => "fa-user", "fa-film" => "fa-film", "fa-th-large" => "fa-th-large", "fa-th" => "fa-th", "fa-th-list" => "fa-th-list", "fa-check" => "fa-check", "fa-times" => "fa-times", "fa-search-plus" => "fa-search-plus", "fa-search-minus" => "fa-search-minus", "fa-power-off" => "fa-power-off", "fa-signal" => "fa-signal", "fa-cog" => "fa-cog", "fa-trash-o" => "fa-trash-o", "fa-home" => "fa-home", "fa-file-o" => "fa-file-o", "fa-clock-o" => "fa-clock-o", "fa-road" => "fa-road", "fa-download" => "fa-download", "fa-arrow-circle-o-down" => "fa-arrow-circle-o-down", "fa-arrow-circle-o-up" => "fa-arrow-circle-o-up", "fa-inbox" => "fa-inbox", "fa-play-circle-o" => "fa-play-circle-o", "fa-repeat" => "fa-repeat", "fa-refresh" => "fa-refresh", "fa-list-alt" => "fa-list-alt", "fa-lock" => "fa-lock", "fa-flag" => "fa-flag", "fa-headphones" => "fa-headphones", "fa-volume-off" => "fa-volume-off", "fa-volume-down" => "fa-volume-down", "fa-volume-up" => "fa-volume-up", "fa-qrcode" => "fa-qrcode", "fa-barcode" => "fa-barcode", "fa-tag" => "fa-tag", "fa-tags" => "fa-tags", "fa-book" => "fa-book", "fa-bookmark" => "fa-bookmark", "fa-print" => "fa-print", "fa-camera" => "fa-camera", "fa-font" => "fa-font", "fa-bold" => "fa-bold", "fa-italic" => "fa-italic", "fa-text-height" => "fa-text-height", "fa-text-width" => "fa-text-width", "fa-align-left" => "fa-align-left", "fa-align-center" => "fa-align-center", "fa-align-right" => "fa-align-right", "fa-align-justify" => "fa-align-justify", "fa-list" => "fa-list", "fa-outdent" => "fa-outdent", "fa-indent" => "fa-indent", "fa-video-camera" => "fa-video-camera", "fa-picture-o" => "fa-picture-o", "fa-pencil" => "fa-pencil", "fa-map-marker" => "fa-map-marker", "fa-adjust" => "fa-adjust", "fa-tint" => "fa-tint", "fa-pencil-square-o" => "fa-pencil-square-o", "fa-share-square-o" => "fa-share-square-o", "fa-check-square-o" => "fa-check-square-o", "fa-arrows" => "fa-arrows", "fa-step-backward" => "fa-step-backward", "fa-fast-backward" => "fa-fast-backward", "fa-backward" => "fa-backward", "fa-play" => "fa-play", "fa-pause" => "fa-pause", "fa-stop" => "fa-stop", "fa-forward" => "fa-forward", "fa-fast-forward" => "fa-fast-forward", "fa-step-forward" => "fa-step-forward", "fa-eject" => "fa-eject", "fa-chevron-left" => "fa-chevron-left", "fa-chevron-right" => "fa-chevron-right", "fa-plus-circle" => "fa-plus-circle", "fa-minus-circle" => "fa-minus-circle", "fa-times-circle" => "fa-times-circle", "fa-check-circle" => "fa-check-circle", "fa-question-circle" => "fa-question-circle", "fa-info-circle" => "fa-info-circle", "fa-crosshairs" => "fa-crosshairs", "fa-times-circle-o" => "fa-times-circle-o", "fa-check-circle-o" => "fa-check-circle-o", "fa-ban" => "fa-ban", "fa-arrow-left" => "fa-arrow-left", "fa-arrow-right" => "fa-arrow-right", "fa-arrow-up" => "fa-arrow-up", "fa-arrow-down" => "fa-arrow-down", "fa-share" => "fa-share", "fa-expand" => "fa-expand", "fa-compress" => "fa-compress", "fa-plus" => "fa-plus", "fa-minus" => "fa-minus", "fa-asterisk" => "fa-asterisk", "fa-exclamation-circle" => "fa-exclamation-circle", "fa-gift" => "fa-gift", "fa-leaf" => "fa-leaf", "fa-fire" => "fa-fire", "fa-eye" => "fa-eye", "fa-eye-slash" => "fa-eye-slash", "fa-exclamation-triangle" => "fa-exclamation-triangle", "fa-plane" => "fa-plane", "fa-calendar" => "fa-calendar", "fa-random" => "fa-random", "fa-comment" => "fa-comment", "fa-magnet" => "fa-magnet", "fa-chevron-up" => "fa-chevron-up", "fa-chevron-down" => "fa-chevron-down", "fa-retweet" => "fa-retweet", "fa-shopping-cart" => "fa-shopping-cart", "fa-folder" => "fa-folder", "fa-folder-open" => "fa-folder-open", "fa-arrows-v" => "fa-arrows-v", "fa-arrows-h" => "fa-arrows-h", "fa-bar-chart" => "fa-bar-chart", "fa-twitter-square" => "fa-twitter-square", "fa-facebook-square" => "fa-facebook-square", "fa-camera-retro" => "fa-camera-retro", "fa-key" => "fa-key", "fa-cogs" => "fa-cogs", "fa-comments" => "fa-comments", "fa-thumbs-o-up" => "fa-thumbs-o-up", "fa-thumbs-o-down" => "fa-thumbs-o-down", "fa-star-half" => "fa-star-half", "fa-heart-o" => "fa-heart-o", "fa-sign-out" => "fa-sign-out", "fa-linkedin-square" => "fa-linkedin-square", "fa-thumb-tack" => "fa-thumb-tack", "fa-external-link" => "fa-external-link", "fa-sign-in" => "fa-sign-in", "fa-trophy" => "fa-trophy", "fa-github-square" => "fa-github-square", "fa-upload" => "fa-upload", "fa-lemon-o" => "fa-lemon-o", "fa-phone" => "fa-phone", "fa-square-o" => "fa-square-o", "fa-bookmark-o" => "fa-bookmark-o", "fa-phone-square" => "fa-phone-square", "fa-twitter" => "fa-twitter", "fa-facebook" => "fa-facebook", "fa-github" => "fa-github", "fa-unlock" => "fa-unlock", "fa-credit-card" => "fa-credit-card", "fa-rss" => "fa-rss", "fa-hdd-o" => "fa-hdd-o", "fa-bullhorn" => "fa-bullhorn", "fa-bell" => "fa-bell", "fa-certificate" => "fa-certificate", "fa-hand-o-right" => "fa-hand-o-right", "fa-hand-o-left" => "fa-hand-o-left", "fa-hand-o-up" => "fa-hand-o-up", "fa-hand-o-down" => "fa-hand-o-down", "fa-arrow-circle-left" => "fa-arrow-circle-left", "fa-arrow-circle-right" => "fa-arrow-circle-right", "fa-arrow-circle-up" => "fa-arrow-circle-up", "fa-arrow-circle-down" => "fa-arrow-circle-down", "fa-globe" => "fa-globe", "fa-wrench" => "fa-wrench", "fa-tasks" => "fa-tasks", "fa-filter" => "fa-filter", "fa-briefcase" => "fa-briefcase", "fa-arrows-alt" => "fa-arrows-alt", "fa-users" => "fa-users", "fa-link" => "fa-link", "fa-cloud" => "fa-cloud", "fa-flask" => "fa-flask", "fa-scissors" => "fa-scissors", "fa-files-o" => "fa-files-o", "fa-paperclip" => "fa-paperclip", "fa-floppy-o" => "fa-floppy-o", "fa-square" => "fa-square", "fa-bars" => "fa-bars", "fa-list-ul" => "fa-list-ul", "fa-list-ol" => "fa-list-ol", "fa-strikethrough" => "fa-strikethrough", "fa-underline" => "fa-underline", "fa-table" => "fa-table", "fa-magic" => "fa-magic", "fa-truck" => "fa-truck", "fa-pinterest" => "fa-pinterest", "fa-pinterest-square" => "fa-pinterest-square", "fa-google-plus-square" => "fa-google-plus-square", "fa-google-plus" => "fa-google-plus", "fa-money" => "fa-money", "fa-caret-down" => "fa-caret-down", "fa-caret-up" => "fa-caret-up", "fa-caret-left" => "fa-caret-left", "fa-caret-right" => "fa-caret-right", "fa-columns" => "fa-columns", "fa-sort" => "fa-sort", "fa-sort-desc" => "fa-sort-desc", "fa-sort-asc" => "fa-sort-asc", "fa-envelope" => "fa-envelope", "fa-linkedin" => "fa-linkedin", "fa-undo" => "fa-undo", "fa-gavel" => "fa-gavel", "fa-tachometer" => "fa-tachometer", "fa-comment-o" => "fa-comment-o", "fa-comments-o" => "fa-comments-o", "fa-bolt" => "fa-bolt", "fa-sitemap" => "fa-sitemap", "fa-umbrella" => "fa-umbrella", "fa-clipboard" => "fa-clipboard", "fa-lightbulb-o" => "fa-lightbulb-o", "fa-exchange" => "fa-exchange", "fa-cloud-download" => "fa-cloud-download", "fa-cloud-upload" => "fa-cloud-upload", "fa-user-md" => "fa-user-md", "fa-stethoscope" => "fa-stethoscope", "fa-suitcase" => "fa-suitcase", "fa-bell-o" => "fa-bell-o", "fa-coffee" => "fa-coffee", "fa-cutlery" => "fa-cutlery", "fa-file-text-o" => "fa-file-text-o", "fa-building-o" => "fa-building-o", "fa-hospital-o" => "fa-hospital-o", "fa-ambulance" => "fa-ambulance", "fa-medkit" => "fa-medkit", "fa-fighter-jet" => "fa-fighter-jet", "fa-beer" => "fa-beer", "fa-h-square" => "fa-h-square", "fa-plus-square" => "fa-plus-square", "fa-angle-double-left" => "fa-angle-double-left", "fa-angle-double-right" => "fa-angle-double-right", "fa-angle-double-up" => "fa-angle-double-up", "fa-angle-double-down" => "fa-angle-double-down", "fa-angle-left" => "fa-angle-left", "fa-angle-right" => "fa-angle-right", "fa-angle-up" => "fa-angle-up", "fa-angle-down" => "fa-angle-down", "fa-desktop" => "fa-desktop", "fa-laptop" => "fa-laptop", "fa-tablet" => "fa-tablet", "fa-mobile" => "fa-mobile", "fa-circle-o" => "fa-circle-o", "fa-quote-left" => "fa-quote-left", "fa-quote-right" => "fa-quote-right", "fa-spinner" => "fa-spinner", "fa-circle" => "fa-circle", "fa-reply" => "fa-reply", "fa-github-alt" => "fa-github-alt", "fa-folder-o" => "fa-folder-o", "fa-folder-open-o" => "fa-folder-open-o", "fa-smile-o" => "fa-smile-o", "fa-frown-o" => "fa-frown-o", "fa-meh-o" => "fa-meh-o", "fa-gamepad" => "fa-gamepad", "fa-keyboard-o" => "fa-keyboard-o", "fa-flag-o" => "fa-flag-o", "fa-flag-checkered" => "fa-flag-checkered", "fa-terminal" => "fa-terminal", "fa-code" => "fa-code", "fa-reply-all" => "fa-reply-all", "fa-star-half-o" => "fa-star-half-o", "fa-location-arrow" => "fa-location-arrow", "fa-crop" => "fa-crop", "fa-code-fork" => "fa-code-fork", "fa-chain-broken" => "fa-chain-broken", "fa-question" => "fa-question", "fa-info" => "fa-info", "fa-exclamation" => "fa-exclamation", "fa-superscript" => "fa-superscript", "fa-subscript" => "fa-subscript", "fa-eraser" => "fa-eraser", "fa-puzzle-piece" => "fa-puzzle-piece", "fa-microphone" => "fa-microphone", "fa-microphone-slash" => "fa-microphone-slash", "fa-shield" => "fa-shield", "fa-calendar-o" => "fa-calendar-o", "fa-fire-extinguisher" => "fa-fire-extinguisher", "fa-rocket" => "fa-rocket", "fa-maxcdn" => "fa-maxcdn", "fa-chevron-circle-left" => "fa-chevron-circle-left", "fa-chevron-circle-right" => "fa-chevron-circle-right", "fa-chevron-circle-up" => "fa-chevron-circle-up", "fa-chevron-circle-down" => "fa-chevron-circle-down", "fa-html5" => "fa-html5", "fa-css3" => "fa-css3", "fa-anchor" => "fa-anchor", "fa-unlock-alt" => "fa-unlock-alt", "fa-bullseye" => "fa-bullseye", "fa-ellipsis-h" => "fa-ellipsis-h", "fa-ellipsis-v" => "fa-ellipsis-v", "fa-rss-square" => "fa-rss-square", "fa-play-circle" => "fa-play-circle", "fa-ticket" => "fa-ticket", "fa-minus-square" => "fa-minus-square", "fa-minus-square-o" => "fa-minus-square-o", "fa-level-up" => "fa-level-up", "fa-level-down" => "fa-level-down", "fa-check-square" => "fa-check-square", "fa-pencil-square" => "fa-pencil-square", "fa-external-link-square" => "fa-external-link-square", "fa-share-square" => "fa-share-square", "fa-compass" => "fa-compass", "fa-caret-square-o-down" => "fa-caret-square-o-down", "fa-caret-square-o-up" => "fa-caret-square-o-up", "fa-caret-square-o-right" => "fa-caret-square-o-right", "fa-eur" => "fa-eur", "fa-gbp" => "fa-gbp", "fa-usd" => "fa-usd", "fa-inr" => "fa-inr", "fa-jpy" => "fa-jpy", "fa-rub" => "fa-rub", "fa-krw" => "fa-krw", "fa-btc" => "fa-btc", "fa-file" => "fa-file", "fa-file-text" => "fa-file-text", "fa-sort-alpha-asc" => "fa-sort-alpha-asc", "fa-sort-alpha-desc" => "fa-sort-alpha-desc", "fa-sort-amount-asc" => "fa-sort-amount-asc", "fa-sort-amount-desc" => "fa-sort-amount-desc", "fa-sort-numeric-asc" => "fa-sort-numeric-asc", "fa-sort-numeric-desc" => "fa-sort-numeric-desc", "fa-thumbs-up" => "fa-thumbs-up", "fa-thumbs-down" => "fa-thumbs-down", "fa-youtube-square" => "fa-youtube-square", "fa-youtube" => "fa-youtube", "fa-xing" => "fa-xing", "fa-xing-square" => "fa-xing-square", "fa-youtube-play" => "fa-youtube-play", "fa-dropbox" => "fa-dropbox", "fa-stack-overflow" => "fa-stack-overflow", "fa-instagram" => "fa-instagram", "fa-flickr" => "fa-flickr", "fa-adn" => "fa-adn", "fa-bitbucket" => "fa-bitbucket", "fa-bitbucket-square" => "fa-bitbucket-square", "fa-tumblr" => "fa-tumblr", "fa-tumblr-square" => "fa-tumblr-square", "fa-long-arrow-down" => "fa-long-arrow-down", "fa-long-arrow-up" => "fa-long-arrow-up", "fa-long-arrow-left" => "fa-long-arrow-left", "fa-long-arrow-right" => "fa-long-arrow-right", "fa-apple" => "fa-apple", "fa-windows" => "fa-windows", "fa-android" => "fa-android", "fa-linux" => "fa-linux", "fa-dribbble" => "fa-dribbble", "fa-skype" => "fa-skype", "fa-foursquare" => "fa-foursquare", "fa-trello" => "fa-trello", "fa-female" => "fa-female", "fa-male" => "fa-male", "fa-gittip" => "fa-gittip", "fa-sun-o" => "fa-sun-o", "fa-moon-o" => "fa-moon-o", "fa-archive" => "fa-archive", "fa-bug" => "fa-bug", "fa-vk" => "fa-vk", "fa-weibo" => "fa-weibo", "fa-renren" => "fa-renren", "fa-pagelines" => "fa-pagelines", "fa-stack-exchange" => "fa-stack-exchange", "fa-arrow-circle-o-right" => "fa-arrow-circle-o-right", "fa-arrow-circle-o-left" => "fa-arrow-circle-o-left", "fa-caret-square-o-left" => "fa-caret-square-o-left", "fa-dot-circle-o" => "fa-dot-circle-o", "fa-wheelchair" => "fa-wheelchair", "fa-vimeo-square" => "fa-vimeo-square", "fa-try" => "fa-try", "fa-plus-square-o" => "fa-plus-square-o", "fa-space-shuttle" => "fa-space-shuttle", "fa-slack" => "fa-slack", "fa-envelope-square" => "fa-envelope-square", "fa-wordpress" => "fa-wordpress", "fa-openid" => "fa-openid", "fa-university" => "fa-university", "fa-graduation-cap" => "fa-graduation-cap", "fa-yahoo" => "fa-yahoo", "fa-google" => "fa-google", "fa-reddit" => "fa-reddit", "fa-reddit-square" => "fa-reddit-square", "fa-stumbleupon-circle" => "fa-stumbleupon-circle", "fa-stumbleupon" => "fa-stumbleupon", "fa-delicious" => "fa-delicious", "fa-digg" => "fa-digg", "fa-pied-piper" => "fa-pied-piper", "fa-pied-piper-alt" => "fa-pied-piper-alt", "fa-drupal" => "fa-drupal", "fa-joomla" => "fa-joomla", "fa-language" => "fa-language", "fa-fax" => "fa-fax", "fa-building" => "fa-building", "fa-child" => "fa-child", "fa-paw" => "fa-paw", "fa-spoon" => "fa-spoon", "fa-cube" => "fa-cube", "fa-cubes" => "fa-cubes", "fa-behance" => "fa-behance", "fa-behance-square" => "fa-behance-square", "fa-steam" => "fa-steam", "fa-steam-square" => "fa-steam-square", "fa-recycle" => "fa-recycle", "fa-car" => "fa-car", "fa-taxi" => "fa-taxi", "fa-tree" => "fa-tree", "fa-spotify" => "fa-spotify", "fa-deviantart" => "fa-deviantart", "fa-soundcloud" => "fa-soundcloud", "fa-database" => "fa-database", "fa-file-pdf-o" => "fa-file-pdf-o", "fa-file-word-o" => "fa-file-word-o", "fa-file-excel-o" => "fa-file-excel-o", "fa-file-powerpoint-o" => "fa-file-powerpoint-o", "fa-file-image-o" => "fa-file-image-o", "fa-file-archive-o" => "fa-file-archive-o", "fa-file-audio-o" => "fa-file-audio-o", "fa-file-video-o" => "fa-file-video-o", "fa-file-code-o" => "fa-file-code-o", "fa-vine" => "fa-vine", "fa-codepen" => "fa-codepen", "fa-jsfiddle" => "fa-jsfiddle", "fa-life-ring" => "fa-life-ring", "fa-circle-o-notch" => "fa-circle-o-notch", "fa-rebel" => "fa-rebel", "fa-empire" => "fa-empire", "fa-git-square" => "fa-git-square", "fa-git" => "fa-git", "fa-hacker-news" => "fa-hacker-news", "fa-tencent-weibo" => "fa-tencent-weibo", "fa-qq" => "fa-qq", "fa-weixin" => "fa-weixin", "fa-paper-plane" => "fa-paper-plane", "fa-paper-plane-o" => "fa-paper-plane-o", "fa-history" => "fa-history", "fa-circle-thin" => "fa-circle-thin", "fa-header" => "fa-header", "fa-paragraph" => "fa-paragraph", "fa-sliders" => "fa-sliders", "fa-share-alt" => "fa-share-alt", "fa-share-alt-square" => "fa-share-alt-square", "fa-bomb" => "fa-bomb", "fa-futbol-o" => "fa-futbol-o", "fa-tty" => "fa-tty", "fa-binoculars" => "fa-binoculars", "fa-plug" => "fa-plug", "fa-slideshare" => "fa-slideshare", "fa-twitch" => "fa-twitch", "fa-yelp" => "fa-yelp", "fa-newspaper-o" => "fa-newspaper-o", "fa-wifi" => "fa-wifi", "fa-calculator" => "fa-calculator", "fa-paypal" => "fa-paypal", "fa-google-wallet" => "fa-google-wallet", "fa-cc-visa" => "fa-cc-visa", "fa-cc-mastercard" => "fa-cc-mastercard", "fa-cc-discover" => "fa-cc-discover", "fa-cc-amex" => "fa-cc-amex", "fa-cc-paypal" => "fa-cc-paypal", "fa-cc-stripe" => "fa-cc-stripe", "fa-bell-slash" => "fa-bell-slash", "fa-bell-slash-o" => "fa-bell-slash-o", "fa-trash" => "fa-trash", "fa-copyright" => "fa-copyright", "fa-at" => "fa-at", "fa-eyedropper" => "fa-eyedropper", "fa-paint-brush" => "fa-paint-brush", "fa-birthday-cake" => "fa-birthday-cake", "fa-area-chart" => "fa-area-chart", "fa-pie-chart" => "fa-pie-chart", "fa-line-chart" => "fa-line-chart", "fa-lastfm" => "fa-lastfm", "fa-lastfm-square" => "fa-lastfm-square", "fa-toggle-off" => "fa-toggle-off", "fa-toggle-on" => "fa-toggle-on", "fa-bicycle" => "fa-bicycle", "fa-bus" => "fa-bus", "fa-ioxhost" => "fa-ioxhost", "fa-angellist" => "fa-angellist", "fa-cc" => "fa-cc", "fa-ils" => "fa-ils", "fa-meanpath" => "fa-meanpath");
        // }
        $services_options = new AT_Meta_Box($config);
        $services_options->addTextarea($prefix . 'service_text', array('name' => 'Service Text', 'desc' => 'Add your text for the service item.', 'std' => ''));
        $services_options->addSelectIcon($prefix . 'service_icon', $icons, array('name' => 'Service Icon', 'std' => array('fa-glass'), 'desc' => 'Select an icon for your service item. Icons belong to <a href="http://fortawesome.github.io/Font-Awesome/" target="_blank">FontAwesome</a>, the iconic font designed for Bootstrap.'));
        // $services_options->addImageRadio($prefix.'service_style',array('service-style-2'=>'Service Style 2', 'service-style-1'=>'Service Style 1'),array('name'=> 'Service Style', 'std'=> array('service-style-2'), 'desc' => ''));
        $services_options->Finish();
        /*-----------------------------------------------------------------------------------
        /*	Blog Post Formats
        /*-----------------------------------------------------------------------------------*/
        // Metaboxes for Standard Post Format
        $config = array('id' => 'dt_standard_post_custom_fields', 'title' => 'Standard Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $standard_post = new AT_Meta_Box($config);
        $standard_post->addSelect($prefix . 'standard_select', array('selectkey1' => 'Display the featured image', 'selectkey2' => 'Don`t display the featured image'), array('name' => 'Featured image options for listing pages(blog pages)', 'std' => array('selectkey1'), 'desc' => 'Choose whether to display the featured image or not on blog listing pages. Make sure you set a "Featured Image" by using the box from right-bottom side of the screen.'));
        $standard_post->Finish();
        // Metaboxes for Gallery Post Format
        $config = array('id' => 'dt_gallery_post_custom_fields', 'title' => 'Gallery Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $gallery_post = new AT_Meta_Box($config);
        $gallery_fields[] = $gallery_post->addImage($prefix . 'gallery_post', array('desc' => '', 'name' => 'Photo URL ', 'class' => 'image-field'), true);
        $gallery_fields[] = $gallery_post->addText($prefix . 'gallery_photo_name', array('name' => 'Photo Name '), true);
        $gallery_fields[] = $gallery_post->addText($prefix . 'gallery_photo_desc', array('name' => 'Photo Description '), true);
        $gallery_post->addRepeaterBlock($prefix . 'gallery_block', array('desc' => 'Upload images for the gallery. They will be grouped into a slider', 'inline' => true, 'name' => 'Gallery Images', 'fields' => $gallery_fields, 'sortable' => true));
        //$gallery_post->addSelect($prefix.'gallery_select',array('selectkey1'=>'Display the gallery same as on single page','selectkey2'=>'Display only the first image from gallery as featured image', 'selectkey3' => 'Don`t display any image/gallery'),array('name'=> 'Displaying gallery in listing pages(blog page)', 'std'=> array('selectkey1'), 'desc' => 'Choose whether to display the gallery, only the first image or none on blog listing pages.'));
        $gallery_post->Finish();
        // Metaboxes for Link Post Format
        $config = array('id' => 'dt_link_post_custom_fields', 'title' => 'Link Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $link_post = new AT_Meta_Box($config);
        $link_post->addText($prefix . 'link_block', array('name' => 'Link URL', 'desc' => 'Add a link for the "Link Post Format". The title of the post will link to the URL you`ve set.', 'std' => ''));
        $link_post->addRadio($prefix . 'link_radio', array('blank' => '_blank: New window or tab', 'self' => '_self: Same window or tab'), array('name' => 'Target of the link', 'desc' => 'Set the target of the link.', 'std' => array('blank')));
        $link_post->addText($prefix . 'link_relationship', array('name' => 'Link Relationship (optional)', 'desc' => 'Set the link "rel" attribute(ex: nofollow, dofollow, etc).', 'std' => ''));
        $link_post->Finish();
        // Metaboxes for Quote Post Format
        $config = array('id' => 'dt_quote_post_custom_fields', 'title' => 'Quote Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $quote_post = new AT_Meta_Box($config);
        $quote_post->addTextarea($prefix . 'quote_block', array('name' => 'Quote', 'desc' => 'Add your text for the quote.', 'std' => ''));
        $quote_post->addText($prefix . 'quote_author', array('name' => 'Quote author', 'desc' => 'The person who said that quote.', 'std' => ''));
        $quote_post->Finish();
        // Metaboxes for Audio Post Format
        $config = array('id' => 'dt_audio_post_custom_fields', 'title' => 'Audio Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $audio_post = new AT_Meta_Box($config);
        $audio_post->addText($prefix . 'mp3_audio_block', array('name' => 'MP3 File URL', 'desc' => '', 'std' => ''));
        $audio_post->addText($prefix . 'ogg_audio_block', array('name' => 'OGA/OGG File URL', 'desc' => '', 'std' => ''));
        $audio_post->addInfo($prefix . 'info_audio_block', array('name' => '', 'desc' => 'Use the "Featured Image" function to upload a poster image(working like a thumbnail)<br/> for this audio post format.', 'std' => ''));
        $audio_post->Finish();
        // Metaboxes for Video Post Format
        $config = array('id' => 'dt_video_post_custom_fields', 'title' => 'Video Post Format Options', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $video_post = new AT_Meta_Box($config);
        $video_post->addText($prefix . 'external_video_block', array('name' => 'External URL(embed YouTube or Vimeo videos )', 'desc' => 'Use an YouTube or Vimeo page URL(ex: http://www.youtube.com/watch?v=x6qe_kVaBpg). The embed code will be automatically created.', 'std' => ''));
        $video_post->Finish();
        /*-----------------------------------------------------------------------------------*/
        /*	Custom Post Types Boxes
        /*-----------------------------------------------------------------------------------*/
        // Portfolio Title Metabox
        $config = array('id' => 'portfolio_title', 'title' => 'Header Options', 'pages' => array('portfolio'), 'context' => 'normal', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $port_header = new AT_Meta_Box($config);
        $port_header->addText($prefix . 'page_tagline', array('name' => 'Title Tagline', 'desc' => 'You can set a tagline for the title.'));
        $port_header->addSelect($prefix . 'portf_header', array('center-title' => 'Center Aligned Title', 'left-title' => 'Left Aligned Title', 'no-title' => 'No Title', 'parallax-title' => 'Center Aligned Title on Background Image'), array('name' => 'Project Title Options', 'std' => array('center-title')));
        $port_header->Finish();
        $config = array('id' => 'dt_parallax_bg', 'title' => 'Background Options', 'pages' => array('portfolio'), 'context' => 'normal', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $bg_options = new AT_Meta_Box($config);
        $bg_options->addInfo($prefix . 'info_parallax_bg', array('name' => '', 'desc' => 'Upload an image. You mainly have 3 options: upload an image and set it as background; upload an image and make it act like a pattern by choosing options like repeat or pick a color.', 'std' => ''));
        $bg_options->addImageSolo($prefix . 'bg_img', array('name' => 'Background Image '));
        $bg_options->addRadio($prefix . 'bg_repeat', array('repeat' => 'Repeat', 'repeat-y' => 'Repeat-Y', 'repeat-x' => 'Repeat-X', 'no-repeat' => 'No Repeat'), array('name' => 'Background Repeat', 'std' => 'repeat-y'));
        $bg_options->addColor($prefix . 'bg_color', array('name' => 'Background Color', 'std' => '#111111', 'desc' => 'You can set a color over the background image. You can make it more or less opaque, by using the next setting.'));
        $bg_options->addText($prefix . 'bg_color_opacity', array('name' => 'Background Color Opacity', 'std' => '70', 'desc' => 'Set an opacity value for the color(values between 0-100). 0 means no color while 100 means solid color.'));
        $bg_options->addRadio($prefix . 'bg_text', array('light-text' => 'Light Text', 'dark-text' => 'Dark Text'), array('name' => 'Text Color Scheme', 'std' => 'light-text', 'desc' => 'Pick a color scheme for the parallax text. "Light Text" looks good on dark bg images while "Dark Text" looks good on light images.'));
        $bg_options->Finish();
        // Portfolio Icon Metabox
        $config = array('id' => 'portfolio_icon', 'title' => 'Thumbnail(Featured Image) options:', 'pages' => array('portfolio'), 'context' => 'side', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $port_icon = new AT_Meta_Box($config);
        $port_icon->addSelect($prefix . 'portf_icon', array('link_to_page' => 'Opens the Portfolio Item', 'lightbox_to_image' => 'Is Opening in a Lightbox', 'link_to_link' => 'Opens a Custom Link', 'lightbox_to_video' => 'Opens a Video in a Lightbox', 'lightbox_to_gallery' => 'Opens an Image Gallery in a Lightbox'), array('name' => 'What thumbnail does: ', 'std' => array('link_to_page')));
        $port_icon->addText($prefix . 'portf_link', array('name' => 'Custom Link: ', 'desc' => 'You can set the thumbnail to open a custom link.'));
        $port_icon->addText($prefix . 'portf_video', array('name' => 'Video URL: ', 'desc' => 'You can set the thumbnail to open a video from third-party websites(Vimeo, YouTube) in an URL. Ex: http://www.youtube.com/watch?v=y6Sxv-sUYtM'));
        $gl_fields[] = $port_icon->addImage($prefix . 'gl_url', array('desc' => '', 'name' => 'Photo URL ', 'class' => 'image-field'), true);
        $port_icon->addRepeaterBlock($prefix . 'portf_gallery', array('desc' => 'Upload images for the gallery. They will appear in lightbox, when the thumbnail will be clicked.', 'inline' => true, 'name' => 'Gallery Images', 'fields' => $gl_fields, 'sortable' => true));
        $port_icon->addImageRadio($prefix . 'portf_thumbnail', array('portfolio-small' => 'Small Thumbnail', 'portfolio-big' => 'Big Thumbnail', 'half-horizontal' => 'Half Horizontal', 'half-vertical' => 'Half Vertical'), array('name' => 'Thumbnail Size', 'std' => array('portfolio-small'), 'desc' => 'Working with the Portfolio Grid layout option'));
        $port_icon->Finish();
        // Testimonials Metaboxes
        $config = array('id' => 'testimonials_box', 'title' => 'Testimonial Details', 'pages' => array('testimonials'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $test_box = new AT_Meta_Box($config);
        $test_box->addTextarea($prefix . 'testimonial_desc', array('name' => 'Testimonial Text', 'desc' => 'Write a testimonial into the textarea.'));
        $test_box->addText($prefix . 'testimonial_name', array('name' => 'By who? ', 'desc' => 'Name of the client who gave feedback'));
        $test_box->addText($prefix . 'testimonial_details', array('name' => 'More details about the client: ', 'desc' => 'You can add here the company he/she works in, position in the company, etc.'));
        $test_box->Finish();
        // Page Sidebars Metabox
        $config = array('id' => 'page_sidebars', 'title' => 'Page Layout', 'pages' => array('page'), 'context' => 'side', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $page_sidebar = new AT_Meta_Box($config);
        $all_sidebars = array();
        if (class_exists('SidebarGenerator')) {
            $all_sidebars = SidebarGenerator::get_all_sidebars();
        } else {
            $all_sidebars = delicious_my_sidebars();
        }
        $page_sidebar->addImageRadio($prefix . 'sidebar_position', array('sidebar-right' => 'Right Sidebar', 'sidebar-left' => 'Left Sidebar', 'no-sidebar' => 'No Sidebar'), array('name' => 'Sidebar position', 'std' => array('sidebar-right')));
        $page_sidebar->addSelect($prefix . 'all_sidebars', $all_sidebars, array('name' => 'Pick a sidebar '));
        $page_sidebar->Finish();
        //Team Details Meta Boxes
        $config = array('id' => 'team_details', 'title' => 'Team Member Details', 'pages' => array('team'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $team_meta = new AT_Meta_Box($config);
        $team_meta->addTextarea($prefix . 'member_text', array('name' => 'About the Team Member', 'desc' => 'Some words about the member'));
        $team_meta->addText($prefix . 'member_position', array('name' => 'Company Position ', 'desc' => 'Ex: Web Developer or Sales Manager'));
        $team_meta->addText($prefix . 'member_mail', array('name' => 'Email Address ', 'desc' => 'Ex: email@mywebsite.com'));
        $team_meta->addText($prefix . 'member_twitter', array('name' => 'Twitter URL ', 'desc' => 'Ex: https://twitter.com/#!/deliciousthemes'));
        $team_meta->addText($prefix . 'member_facebook', array('name' => 'Facebook URL', 'desc' => 'Ex: http://www.facebook.com/madalin.tudose'));
        $team_meta->addText($prefix . 'member_linkedin', array('name' => 'LinkedIn URL', 'desc' => 'Ex: http://www.linkedin.com/profile/view?id=163099926'));
        $team_meta->addText($prefix . 'member_google', array('name' => 'Google+ URL', 'desc' => 'Ex: https://plus.google.com/+nettuts/'));
        $team_meta->addText($prefix . 'member_pinterest', array('name' => 'Pinterest URL', 'desc' => 'Ex: http://www.pinterest.com/'));
        $team_meta->addText($prefix . 'member_instagram', array('name' => 'Instagram URL', 'desc' => 'Ex: http://www.instagram.com/'));
        $team_meta->addText($prefix . 'member_custom', array('name' => 'Custom URL', 'desc' => 'Ex: You can add an URL to a custom link'));
        $team_meta->Finish();
        // Member Icon Metabox
        $config = array('id' => 'team_thumbnail', 'title' => 'Thumbnail(Featured Image) options:', 'pages' => array('team'), 'context' => 'side', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
        $team_thumb = new AT_Meta_Box($config);
        $team_thumb->addSelect($prefix . 'team_thumb_icon', array('team_to_image' => 'Is Opening in a Lightbox', 'team_to_link' => 'Opens a Custom Link', 'flat_image' => 'Does Nothing'), array('name' => 'What thumbnail does: ', 'std' => array('team_to_image')));
        $team_thumb->addText($prefix . 'team_link', array('name' => 'Custom Link: ', 'desc' => 'You can set the thumbnail to open a custom link.'));
        $team_thumb->Finish();
    }
}
<?php

require_once "meta-box-class.php";
if (is_admin()) {
    //All meta boxes prefix, inherited from theme Shortname
    $prefix = SN;
    //Meta box config
    $config = array('id' => 'post_format_info', 'title' => 'Slider Info', 'pages' => array('slider'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate Meta box
    $my_meta = new AT_Meta_Box($config);
    $my_meta->addText($prefix . 'slider_client', array('name' => 'Client ', 'desc' => 'Name of the client'));
    //Finish Meta box declaration
    $my_meta->Finish();
}
    //Initiate Volunteering info meta box
    $my_meta5 = new AT_Meta_Box($config5);
    //Volunteering info fields
    $repeater_fields5[] = $my_meta5->addText($prefix . 'volunteering_title', array('name' => 'Volunteering Title '), true);
    $repeater_fields5[] = $my_meta5->addTextarea($prefix . 'volunteering_description', array('name' => 'Volunteering Description '), true);
    $repeater_fields5[] = $my_meta5->addDate($prefix . 'volunteering_fromdate', array('name' => 'Start Date '), true);
    $repeater_fields5[] = $my_meta5->addDate($prefix . 'volunteering_todate', array('name' => 'End Date ', 'desc' => 'Use "PRESENT", if you are still Volunteering'), true);
    $repeater_fields5[] = $my_meta5->addText($prefix . 'volunteering_name', array('name' => 'Volunteerers Name '), true);
    $repeater_fields5[] = $my_meta5->addText($prefix . 'volunteering_url', array('name' => 'Volunteerers Url ', 'desc' => 'Make sure to include http:// in the URL'), true);
    //Volunteering repeater block
    $my_meta5->addRepeaterBlock($prefix . 'volunteering_', array('inline' => true, 'name' => 'Enter your volunteering info', 'fields' => $repeater_fields5, 'sortable' => true));
    //Finish Volunteering info meta mox decleration
    $my_meta5->Finish();
    //Project info meta box config
    $config6 = array('id' => 'project', 'title' => 'Applied Projects', 'pages' => array('resume'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate Project info meta box
    $my_meta6 = new AT_Meta_Box($config6);
    //Project info fields
    $repeater_fields6[] = $my_meta6->addText($prefix . 'project_title', array('name' => 'Project Title '), true);
    $repeater_fields6[] = $my_meta6->addTextarea($prefix . 'project_description', array('name' => 'Project Description '), true);
    $repeater_fields6[] = $my_meta6->addDate($prefix . 'project_fromdate', array('name' => 'Start Date '), true);
    $repeater_fields6[] = $my_meta6->addDate($prefix . 'project_todate', array('name' => 'End Date ', 'desc' => 'Use "PRESENT", if you are still Project'), true);
    $repeater_fields6[] = $my_meta6->addText($prefix . 'project_name', array('name' => 'Project Name '), true);
    $repeater_fields6[] = $my_meta6->addText($prefix . 'project_url', array('name' => 'Project Url ', 'desc' => 'Make sure to include http:// in the URL'), true);
    $repeater_fields6[] = $my_meta6->addText($prefix . 'project_blog', array('name' => 'Project Blog '), true);
    $repeater_fields6[] = $my_meta6->addText($prefix . 'project_blog_url', array('name' => 'Project Blog Url ', 'desc' => 'Make sure to include http:// in the URL'), true);
    //Project repeater block
    $my_meta6->addRepeaterBlock($prefix . 'project_', array('inline' => true, 'name' => 'Enter your project info', 'fields' => $repeater_fields6, 'sortable' => true));
    //Finish Project info meta mox decleration
    $my_meta6->Finish();
}
Ejemplo n.º 4
0
    $repeater_fields[] = $post_gallery_meta->addImage($prefix . 'gallery_post_image', array('name' => 'Gallery Image ', 'desc' => 'Click to upload image to this gallery post.'), true);
    $post_gallery_meta->addRepeaterBlock($prefix . 'gallery_post_images_', array('inline' => true, 'name' => 'Gallery Images', 'fields' => $repeater_fields));
    $post_gallery_meta->Finish();
    //IMAGE
    $post_image_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_image', 'title' => 'Image')));
    $post_image_meta->addImage($prefix . 'image_post_upload', array('name' => 'Image Post ', 'desc' => 'Click to upload image to this post.'));
    $post_image_meta->Finish();
    //LINK
    $post_link_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_link', 'title' => 'Link')));
    $post_link_meta->addText($prefix . 'link_post_url', array('name' => 'Link URL ', 'desc' => 'Enter the URL to be used for this Link post. for example: http://besttheme.net'));
    $post_link_meta->addText($prefix . 'link_post_description', array('name' => 'Link Description ', 'desc' => 'Enter the description to be used for this link. for example: besttheme'));
    $post_link_meta->Finish();
    //QUOTE
    $post_quote_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_quote', 'title' => 'Quote')));
    $post_quote_meta->addText($prefix . 'quote_post', array('name' => 'The Quote ', 'desc' => 'Input your quote.'));
    $post_quote_meta->addText($prefix . 'quote_author', array('name' => 'Quote Author ', 'desc' => 'Enter the quote author name.'));
    $post_quote_meta->Finish();
    //VIDEO
    $post_video_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_video', 'title' => 'Video')));
    //$post_video_meta->addText ($prefix.'video_post_m4v',array('name'=> 'M4V File URL ','desc' => 'Enter the URL to the .m4v video file url.'));
    //$post_video_meta->addText ($prefix.'video_post_ogv',array('name'=> 'OGV File URL ','desc' => 'Enter the URL to the .ogv video file url.'));
    //$post_video_meta->addImage($prefix.'video_post_poster',array('name'=> 'Video Poster Image ','desc' => 'The preview image. The preview image should be min 500px wide.'));
    $post_video_meta->addText($prefix . 'video_post_embed', array('name' => 'Embedded Video Code ', 'desc' => 'If you are using something like Youtube or Vimeo, paste the embed code here'));
    $post_video_meta->Finish();
    //AUDIO
    $post_audio_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_audio', 'title' => 'Audio')));
    $post_audio_meta->addText($prefix . 'audio_post_mp3', array('name' => 'MP3 File URL ', 'desc' => 'Enter the URL to the .mp3 audio file url.'));
    $post_audio_meta->addText($prefix . 'audio_post_ogg', array('name' => 'OGG File URL ', 'desc' => 'Enter the URL to the .oga, .ogg audio file url'));
    //$post_audio_meta->addImage($prefix.'audio_post_poster', array('name'=> 'Audio Poster Image ','desc' => 'The preview image for this audio track. Image width should be min 500px.'));
    $post_audio_meta->Finish();
}
Ejemplo n.º 5
0
 /*
  * Then just add the fields to the repeater block
  */
 //repeater block
 $my_meta2->addCondition('conditinal_fields', array('name' => __('Enable conditinal fields? ', 'mmb'), 'desc' => __('<small>Turn ON if you want to enable the <strong>conditinal fields</strong>.</small>', 'mmb'), 'fields' => $Conditinal_fields, 'std' => false));
 /*
  * Don't Forget to Close up the meta box Declaration 
  */
 //Finish Meta Box Declaration
 $my_meta2->Finish();
 $prefix = "_groupped_";
 $config3 = array('id' => 'demo_meta_box3', 'title' => 'Groupped Meta Box fields', 'pages' => array('post', 'page'), 'context' => 'normal', 'priority' => 'low', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
 /*
  * Initiate your 3rd meta box
  */
 $my_meta3 = new AT_Meta_Box($config3);
 //first field of the group has 'group' => 'start' and last field has 'group' => 'end'
 //text field
 $my_meta3->addText($prefix . 'text_field_id', array('name' => 'My Text ', 'group' => 'start'));
 //textarea field
 $my_meta3->addTextarea($prefix . 'textarea_field_id', array('name' => 'My Textarea '));
 //checkbox field
 $my_meta3->addCheckbox($prefix . 'checkbox_field_id', array('name' => 'My Checkbox '));
 //select field
 $my_meta3->addSelect($prefix . 'select_field_id', array('selectkey1' => 'Select Value1', 'selectkey2' => 'Select Value2'), array('name' => 'My select ', 'std' => array('selectkey2')));
 //radio field
 $my_meta3->addRadio($prefix . 'radio_field_id', array('radiokey1' => 'Radio Value1', 'radiokey2' => 'Radio Value2'), array('name' => 'My Radio Filed', 'std' => array('radionkey2'), 'group' => 'end'));
 /*
  * Don't Forget to Close up the meta box Declaration 
  */
 //Finish Meta Box Declaration
Ejemplo n.º 6
0
{
    register_post_type('blog', array('labels' => array('name' => 'Blogs', 'singular_name' => 'Blog', 'all_items' => 'All Blogs', 'add_new' => 'Add new Blog', 'edit_item' => 'Edit Blog', 'new_item' => 'New Blog', 'view_item' => 'View Blog', 'search_items' => 'Search Blog', 'not_found' => 'No Blog found', 'not_found_in_trash' => 'No Blog found in Trash'), 'public' => true, 'has_archive' => true, 'menu_position' => 5, 'rewrite' => array('slug' => 'blog', 'with_front' => false), 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'author'), 'taxonomies' => array('category', 'post_tag')));
}
add_action('init', 'create_post_type');
/**
 * Register Meta-Box-Class: Posts.
 *
 */
if (is_admin()) {
    //include the main class file
    require_once "library/meta-box-class/my-meta-box-class.php";
    $prefix = 'galausehat_';
    // Add video meta
    $config = array('id' => $prefix . 'posts', 'title' => 'More Configurations', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    /* Initiate your meta box */
    $meta_video = new AT_Meta_Box($config);
    $meta_video->addCheckbox($prefix . 'post_header_enable', array('name' => 'Enable Header Image'));
    $meta_video->addColor($prefix . 'post_title_color', array('name' => 'Title Custom Color'));
    $meta_video->addColor($prefix . 'post_excerpt_color', array('name' => 'Sub Title (Excerpt) Custom Color'));
    $meta_video->Finish();
}
function header_post_title()
{
    global $wpdb;
    if (is_single()) {
        $meta = get_post_meta(get_the_ID());
        if ($meta['galausehat_post_header_enable'][0]) {
            echo "\n\n<style>\n.single #header { min-height:100%; }\n";
            echo ".single #belakang, .page #belakang { background-color: transparent; }\n";
            if ($meta['galausehat_post_title_color'][0] != '#') {
                echo ".header--post-title h1 { color:" . $meta['galausehat_post_title_color'][0] . "; }\n";
Ejemplo n.º 7
0
<?php

require_once "meta-box-class.php";
if (is_admin()) {
    //All meta boxes prefix, inherited from theme Shortname
    $prefix = SN;
    //Meta box config
    $config = array('id' => 'slider_settings', 'title' => 'Slider Settings', 'pages' => array('slider'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate Meta box
    $my_meta = new AT_Meta_Box($config);
    $my_meta->addText($prefix . 'slider_item_caption', array('name' => 'Slider Item Caption ', 'desc' => 'Enter slider item caption (leave blank if you dont want caption)'));
    $my_meta->addText($prefix . 'slider_item_link', array('name' => 'Slider Item Link ', 'desc' => 'Enter slider item link'));
    $my_meta->addImage($prefix . 'slider_item_img', array('name' => 'Slider Item Image ', 'desc' => 'Upload slider item image'));
    //Finish Meta box declaration
    $my_meta->Finish();
}
Ejemplo n.º 8
0
 public function __construct($meta_box)
 {
     parent::__construct($meta_box);
     add_action('admin_enqueue_scripts', array($this, 'load_switch_scripts_styles'));
 }
    $prefix = 'fw_';
    //Quote meta box config
    $config1 = array('id' => 'quote_post', 'title' => 'Quote Settings', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate quote meta box
    $my_meta1 = new AT_Meta_Box($config1);
    //Quote fields
    $my_meta1->addTextarea($prefix . 'quote_post', array('name' => 'The Quote ', 'desc' => 'Enter your quote.'));
    $my_meta1->addText($prefix . 'quote_author', array('name' => 'Quote Author ', 'desc' => 'Enter the quote author name.'));
    //Finish quote meta box decleration
    $my_meta1->Finish();
    //Link meta box config
    $config2 = array('id' => 'link_post', 'title' => 'Link Settings', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate link meta box
    $my_meta2 = new AT_Meta_Box($config2);
    //Link fields
    $my_meta2->addText($prefix . 'link_post_url', array('name' => 'Link URL ', 'desc' => 'Enter the URL to be used for this Link post. for example: http://www.site5.com'));
    $my_meta2->addTextarea($prefix . 'link_post_description', array('name' => 'Link Description ', 'desc' => 'Enter the description to be used for this link. for example: Site5 WordPress Hosting'));
    //Finish link meta box decleration
    $my_meta2->Finish();
    //Gallery meta box config
    $config3 = array('id' => 'gallery_post', 'title' => 'Gallery Settings', 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate gallery meta box
    $my_meta3 = new AT_Meta_Box($config3);
    //Gallery fields
    $repeater_fields[] = $my_meta3->addText($prefix . 'gallery_post_image_title', array('name' => 'Gallery Image Title '), true);
    $repeater_fields[] = $my_meta3->addImage($prefix . 'gallery_post_image', array('name' => 'Gallery Image '), true);
    //Gallery repeater block
    $my_meta3->addRepeaterBlock($prefix . 'gl_', array('inline' => true, 'name' => 'Gallery Images', 'desc' => 'Click to upload images to this gallery post. Hold and move to sort images.', 'fields' => $repeater_fields, 'sortable' => true));
    //Finish gallery meta mox decleration
    $my_meta3->Finish();
}
Ejemplo n.º 10
0
    foreach ($appellations as $vin) {
        echo '<div class="small-12 medium-3 columns">';
        echo '<a href="' . get_post_permalink($vin->ID) . '"><article class="article-card">';
        echo '<img src="' . thumb_or_first($vin->ID, false, false, 'medium') . '"/>';
        echo '<div class="card-content">';
        echo '<h2>' . $vin->post_title . '</h2></div></article></a></div>';
    }
}
function create_post_type()
{
    register_post_type('appellation', array('labels' => array('name' => __('Appellations'), 'singular_name' => __('Appellation')), 'public' => true, 'show_ui' => true, 'publicly_queryable' => true, 'query_var' => true, 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'thumbnail'), 'has_archive' => true));
    register_post_type('viticulture', array('labels' => array('name' => __('Page Viticulture'), 'singular_name' => __('section viticulture')), 'public' => true, 'hierarchical' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail')));
    register_post_type('millesimes', array('labels' => array('name' => __('Millésimes'), 'singular_name' => __('Millésime')), 'public' => true, 'hierarchical' => true, 'has_archive' => true));
}
$config = array('id' => 'text2', 'title' => 'Contenu', 'pages' => array('millesime'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
$my_meta = new AT_Meta_Box($config);
$my_meta->addWysiwyg('section2', array('name' => 'Contenu de la 2nd section'));
$my_meta->addWysiwyg('section3', array('name' => 'Contenu de la 3e section'));
$my_meta->addWysiwyg('section4', array('name' => 'Contenu de la 4e section'));
$my_meta->Finish();
//hook into the init action and call create_book_taxonomies when it fires
add_action('init', 'create_topics_hierarchical_taxonomy', 0);
//create a custom taxonomy name it topics for your posts
function create_topics_hierarchical_taxonomy()
{
    // Add new taxonomy, make it hierarchical like categories
    //first do the translations part for GUI
    $labels = array('name' => _x('type-appelation', "Type d'appelation"), 'singular_name' => _x('Type', "Type d'appelation"), 'search_items' => __('Chercher un type'), 'all_items' => __('Tous les types'), 'parent_item' => __('Parent du type'), 'parent_item_colon' => __('Parent du Type:'), 'edit_item' => __('Modifier le type'), 'update_item' => __('Mettre le type à jour'), 'add_new_item' => __('Ajouter un nouveau type'), 'new_item_name' => __('Nouveau nom de type'), 'menu_name' => __("Types d'appellation"));
    // Now register the taxonomy
    register_taxonomy('Types', array('appellation'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'type')));
}
<?php

$prefix = 'ivp_';
/* 
* configure your meta box
*/
$config = array('id' => 'frontpage_banner', 'title' => 'Frontpage Banner', 'pages' => array('page'), 'context' => 'side', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
/*
* Initiate your meta box
*/
$my_meta = new AT_Meta_Box($config);
/*
* Add fields to your meta box
*/
//text field
$my_meta->addText($prefix . 'frontpage_banner_title', array('name' => __('Title', 'ivp')));
//select field
$my_meta->addPosts($prefix . 'frontpage_banner_lnk', array('post_type' => 'page'), array('name' => __('Link to page', 'ivp')));
//Image field
$my_meta->addImage($prefix . 'frontpage_banner_image', array('name' => __('Banner image', 'ivp')));
/*
* Don't Forget to Close up the meta box Declaration 
*/
//Finish Meta Box Declaration
$my_meta->Finish();
Ejemplo n.º 12
0
    $repeater_fields[] = $post_gallery_meta->addImage($prefix . 'gallery_post_image', array('name' => 'Gallery Image ', 'desc' => 'Click to upload image to this gallery post.'), true);
    $post_gallery_meta->addRepeaterBlock($prefix . 'gallery_post_images_', array('inline' => true, 'name' => 'Gallery Images', 'fields' => $repeater_fields));
    $post_gallery_meta->Finish();
    //IMAGE
    $post_image_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_image', 'title' => 'Image')));
    $post_image_meta->addImage($prefix . 'image_post_upload', array('name' => 'Image Post ', 'desc' => 'Click to upload image to this post.'));
    $post_image_meta->Finish();
    //LINK
    $post_link_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_link', 'title' => 'Link')));
    $post_link_meta->addText($prefix . 'link_post_url', array('name' => 'Link URL ', 'desc' => 'Enter the URL to be used for this Link post. for example: http://www.site5.com'));
    $post_link_meta->addText($prefix . 'link_post_description', array('name' => 'Link Description ', 'desc' => 'Enter the description to be used for this link. for example: Site5 WordPress Hosting'));
    $post_link_meta->Finish();
    //QUOTE
    $post_quote_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_quote', 'title' => 'Quote')));
    $post_quote_meta->addText($prefix . 'quote_post', array('name' => 'The Quote ', 'desc' => 'Input your quote.'));
    $post_quote_meta->addText($prefix . 'quote_author', array('name' => 'Quote Author ', 'desc' => 'Enter the quote author name.'));
    $post_quote_meta->Finish();
    //VIDEO
    $post_video_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_video', 'title' => 'Video')));
    $post_video_meta->addText($prefix . 'video_post_m4v', array('name' => 'M4V File URL ', 'desc' => 'Enter the URL to the .m4v video file url.'));
    $post_video_meta->addText($prefix . 'video_post_ogv', array('name' => 'OGV File URL ', 'desc' => 'Enter the URL to the .ogv video file url.'));
    $post_video_meta->addImage($prefix . 'video_post_poster', array('name' => 'Video Poster Image ', 'desc' => 'The preview image. The preview image should be min 500px wide.'));
    $post_video_meta->addText($prefix . 'video_post_embed', array('name' => 'Embedded Video Code ', 'desc' => 'If you are using something other than self hosted video such as Youtube or Vimeo, paste the embed code here'));
    $post_video_meta->Finish();
    //AUDIO
    $post_audio_meta = new AT_Meta_Box(array_merge($configDefaults, array('id' => SN . 'post_format_audio', 'title' => 'Audio')));
    $post_audio_meta->addText($prefix . 'audio_post_mp3', array('name' => 'MP3 File URL ', 'desc' => 'Enter the URL to the .mp3 audio file url.'));
    $post_audio_meta->addText($prefix . 'audio_post_ogg', array('name' => 'OGG File URL ', 'desc' => 'Enter the URL to the .oga, .ogg audio file url'));
    $post_audio_meta->addImage($prefix . 'audio_post_poster', array('name' => 'Audio Poster Image ', 'desc' => 'The preview image for this audio track. Image width should be min 500px.'));
    $post_audio_meta->Finish();
}
Ejemplo n.º 13
0
//hidden field
//to assign the slider to antenna
$slider->addHidden('slide_antenna', array('name' => 'antenna', 'std' => get_cat_if_user($current_user->ID)), false);
/*
* Don't Forget to Close up the meta box deceleration
*/
//Finish Meta Box Deceleration
$slider->Finish();
/**
 * PARTNERS
 */
$c_partner = array('id' => 'upload_img_partner', 'title' => __('Partners logos', 'iftheme'), 'pages' => array('if_partner'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
$partner = new AT_Meta_Box($c_partner);
$repeater_fields_p[] = $partner->addText('partner_title', array('name' => __('Name of the partner', 'iftheme')), true);
$repeater_fields_p[] = $partner->addText('link_to_partner', array('name' => __('Link', 'iftheme')), true);
$repeater_fields_p[] = $partner->addImage('image_logo', array('name' => __('Logo', 'iftheme')), true);
//repeater block
$partner->addRepeaterBlock('re_', array('inline' => true, 'name' => __('Partners logos', 'iftheme'), 'fields' => $repeater_fields_p));
//hidden field
//to assign the slider to antenna
$partner->addHidden('partner_antenna', array('name' => 'antenna', 'std' => get_cat_if_user($current_user->ID)), false);
//Finish Meta Box Deceleration
$partner->Finish();
//DATA for INSCRIPTION FORM
$inscription = array('id' => 'form_infos', 'title' => __('Booking informations', 'iftheme'), 'pages' => array('post'), 'context' => 'advanced', 'priority' => 'low', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
$booking = new AT_Meta_Box($inscription);
$booking->addCheckbox('if_book_enable', array('name' => __('Open booking', 'iftheme'), 'desc' => __("By checking this box, you enable the booking for this event.", 'iftheme')));
$booking->addText('if_book_mail', array('name' => __('Email', 'iftheme'), 'desc' => __("Email to whom send the booking", 'iftheme')));
$booking->addWysiwyg('if_book_desc', array('name' => __('Details', 'iftheme'), 'desc' => __("Some information you want to add at the top of the booking form", 'iftheme'), 'style' => 'height:150px'));
$booking->Finish();
//end INSCRIPTION
Ejemplo n.º 14
0
//wp_enqueue_script('jquery');
/*
 * Config of metabox
 */
$config = array('id' => 'redirect_links_meta_box', 'title' => 'Redirect info', 'pages' => array('redirect'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => false);
/*
 * Register new post_type for new links
 */
add_action('init', 'create_redirect_post_type');
function create_redirect_post_type()
{
    //register post type
    register_post_type('redirect', array('labels' => array('name' => __('Custom Links'), 'singular_name' => __('Custom Link'), 'add_new' => 'Add New Link', 'add_new_item' => 'Add New Link'), 'public' => true, 'has_archive' => true, 'menu_position' => 80, 'supports' => array('title')));
}
//metabox init
$metabox = new AT_Meta_Box($config);
$metabox->addText('redirect_url_meta', array('name' => 'URL'));
// create custom plugin settings menu
add_action('admin_menu', 'redirect_plugin_create_menu');
function redirect_plugin_create_menu()
{
    //create new top-level menu
    //add_options_page('Настройки переадресации', 'Переадресация', 'administrator', __FILE__, 'redirect_plugin_settings_page');
    add_submenu_page('casepress_menu_settings', 'Redirect Plugin Settings', 'Redirect Settings', 'manage_options', 'redirect_settings', 'redirect_plugin_settings_page');
}
//call register settings function
add_action('admin_init', 'register_redirect_settings');
function register_redirect_settings()
{
    //register our settings
    register_setting('redirect-settings-group', 'redirect_link_guest');
Ejemplo n.º 15
0
     * Add fields to your meta box
     */
    //text field
    $ast_meta->addText($prefix . 'videolink', array('name' => 'Your youtube video link'));
    /*
     * Don't Forget to Close up the meta box Declaration 
     */
    //Finish Meta Box Declaration
    $ast_meta->Finish();
    /* 
     * configure your meta box
     */
    $ast_config = array('id' => 'asteria_meta_box', 'title' => 'Asteria Background Per Page', 'pages' => array('post', 'page'), 'context' => 'side', 'priority' => 'low', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    /*
     * Initiate your meta box
     */
    $ast_meta = new AT_Meta_Box($ast_config);
    /*
     * Add fields to your meta box
     */
    //text field
    $ast_meta->addColor($prefix . 'bg_color_id', array('name' => 'Background Color '));
    $ast_meta->addImage($prefix . 'bg_field', array('name' => 'Background Image '));
    $ast_meta->addRadio($prefix . 'radio_field_id3', array('no-repeat' => 'No Repeat', 'repeat' => 'Tile'), array('name' => 'Repeat', 'std' => array('no-repeat')));
    $ast_meta->addRadio($prefix . 'radio_field_id4', array('scroll' => 'Scroll', 'fixed' => 'Fixed'), array('name' => 'Attachment', 'std' => array('scroll')));
    /*
     * Don't Forget to Close up the meta box Declaration 
     */
    //Finish Meta Box Declaration
    $ast_meta->Finish();
}
Ejemplo n.º 16
0
    $repeater_fields[] = $my_meta2->addDate($prefix . 'job_fromdate', array('name' => 'Start Date '), true);
    $repeater_fields[] = $my_meta2->addDate($prefix . 'job_todate', array('name' => 'End Date ', 'desc' => 'Use "PRESENT", if you are still employed'), true);
    $repeater_fields[] = $my_meta2->addText($prefix . 'job_employer', array('name' => 'Employer Name '), true);
    $repeater_fields[] = $my_meta2->addText($prefix . 'job_url', array('name' => 'Employer Url ', 'desc' => 'Make sure to include http:// in the URL'), true);
    //Employment repeater block
    $my_meta2->addRepeaterBlock($prefix . 'job_', array('inline' => true, 'name' => 'Enter your job info', 'fields' => $repeater_fields, 'sortable' => true));
    //Finish employment info meta mox decleration
    $my_meta2->Finish();
    //Education info meta box config
    $config3 = array('id' => 'education_info', 'title' => 'Education', 'pages' => array('resume'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate education info meta box
    $my_meta3 = new AT_Meta_Box($config3);
    //Education info fields
    $repeater_fields1[] = $my_meta3->addText($prefix . 'edu_degree', array('name' => 'School/Degree '), true);
    $repeater_fields1[] = $my_meta3->addDate($prefix . 'edu_year', array('name' => 'Greduation Year '), true);
    //Education repeater block
    $my_meta3->addRepeaterBlock($prefix . 'edu_', array('inline' => true, 'name' => 'Enter your education info', 'fields' => $repeater_fields1, 'sortable' => true));
    //Finish education info meta mox decleration
    $my_meta3->Finish();
    //Skills info meta box config
    $config4 = array('id' => 'skills_info', 'title' => 'Skills', 'pages' => array('resume'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate skills info meta box
    $my_meta4 = new AT_Meta_Box($config4);
    //Skills info fields
    $repeater_fields4[] = $my_meta4->addText($prefix . 'skill_name', array('name' => 'Skill Name '), true);
    $repeater_fields4[] = $my_meta4->addSelect($prefix . 'skill_level', array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'), array('name' => 'Skill Level ', 'std' => array('2')), true);
    //Skills repeater block
    $my_meta4->addRepeaterBlock($prefix . 'skill_', array('inline' => true, 'name' => 'Enter your skill info', 'fields' => $repeater_fields4, 'sortable' => true));
    //Finish skills info meta mox decleration
    $my_meta4->Finish();
}
Ejemplo n.º 17
0
<?php

/*
메인 관리
*/
// 커스텀 포스트 등록
add_action('init', 'mainban_create');
function mainban_create()
{
    register_post_type('mainban', array('labels' => array('name' => '메인', 'singular_name' => 'mainban', 'add_new' => '추가하기', 'add_new_item' => '아이템 추가', 'edit' => '편집', 'edit_item' => '아이템 편집', 'new_item' => '새로운 메인', 'view' => '보기', 'view_item' => '메인 보기', 'search_items' => '메인 검색', 'not_found' => '검색결과 없음', 'not_found_in_trash' => '(휴지통)검색결과 없음', 'parent' => '부모 메인'), 'public' => true, 'menu_position' => 20, 'menu_icon' => 'dashicons-format-gallery', 'supports' => array('title', 'editor', 'comments', 'thumbnail'), 'has_archive' => true, 'rewrite' => false));
}
// 메타 정보 추가
if (is_admin()) {
    $prefix = 'mainban_';
    $config = array('id' => 'metabox', 'title' => '추가정보', 'pages' => array('mainban'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    $mainban_meta = new AT_Meta_Box($config);
    $mainban_meta->addText($prefix . 'engh1', array('name' => '영문제목'));
    $mainban_meta->addText($prefix . 'engh2', array('name' => '영문설명'));
    $mainban_meta->addText($prefix . 'url', array('name' => '링크주소'));
    $mainban_meta->addSelect($prefix . 'target', array('_blank' => '새 창', '_self' => '현재창'), array('name' => '새창열림', 'std' => array('_self')));
    $mainban_meta->Finish();
}
// 분류 체계 추가
add_action('init', 'mainban_category', 0);
function mainban_category()
{
    $labels = array('name' => _x('분류', 'taxonomy general name'), 'singular_name' => _x('mainban_cat', 'taxonomy singular name'), 'search_items' => __('분류 검색'), 'all_items' => __('모든 분류'), 'parent_item' => __('상위 분류'), 'parent_item_colon' => __('상위 분류'), 'edit_item' => __('분류 편집'), 'update_item' => __('분류 수정'), 'add_new_item' => __('분류 추가'), 'new_item_name' => __('새로운 메인'), 'menu_name' => __('분류 관리'));
    register_taxonomy('mainban_cat', array('mainban'), array('hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'mainban_cat')));
}
Ejemplo n.º 18
0
<?php

require_once "meta-box-class.php";
if (is_admin()) {
    //All meta boxes prefix, inherited from theme Shortname
    $prefix = SN;
    //Meta box config
    $config = array('id' => 'menuitem_settings', 'title' => 'Menu Item Settings', 'pages' => array('menu-item'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
    //Initiate Meta box
    $my_meta = new AT_Meta_Box($config);
    $my_meta->addText($prefix . 'menu_item_price', array('name' => 'Menu Item Price ', 'desc' => 'Enter menu item price (leave blank if you dont want price to appear)'));
    //Finish Meta box declaration
    $my_meta->Finish();
}
add_action('init', 'sugestoes_post_type', 0);
if (is_admin()) {
    /*
     * prefix of meta keys, optional
     */
    $prefix = 'cda_';
    /* 
     * configure your meta box
     */
    $config_cat = array('id' => 'cda_meta_box_cat', 'title' => '', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    $config_post = array('id' => 'cda_meta_box_post', 'title' => ' ', 'pages' => array('proposta'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(), 'local_images' => false, 'use_with_theme' => true);
    /*
     * Initiate your meta box
     */
    $my_meta_cat = new Tax_Meta_Class($config_cat);
    $my_meta_post = new AT_Meta_Box($config_post);
    //radio field
    $my_meta_cat->addRadio($prefix . 'radio_field_id', array('piloto' => 'Projeto Piloto', 'conceito' => 'Projeto Conceito'), array('name' => __('Tipo do Projeto', 'tax-meta'), 'std' => array('conceito')));
    //Image field
    $my_meta_cat->addImage($prefix . 'image_field_id', array('name' => __('Imagem representativa ', 'tax-meta')));
    //Color field
    $my_meta_cat->addColor($prefix . 'color_field_id', array('name' => __('Cor representativa ', 'tax-meta')));
    //List of images to build background and slideshow image
    $my_meta_cat->addText($prefix . 'text_field_id', array('name' => __('Lista de ID para imagens a serem utilizadas no mosaico e slideshow ', 'tax-meta')));
    $my_meta_cat->addText($prefix . 'text_field_id_2', array('name' => __('Lista de ID de ícones do passo 3', 'tax-meta')));
    $my_meta_cat->addImage($prefix . 'image_2_field_id', array('name' => __('Mapa para Sugestões do Passo 3', 'tax-meta')));
    //Color field
    $my_meta_post->addColor($prefix . 'color_field_id_post', array('name' => 'Cor representativa '));
    //Finish Meta Box Decleration
    $my_meta_cat->Finish();
    $my_meta_post->Finish();