Esempio n. 1
0
function yiw_portfolio_metaboxes()
{
    global $yiw_portfolio_type;
    $options_args = array(10 => array('type' => 'paragraph', 'text' => __('Set here the features of this portfolio. On right side, you can also choose an icon to show in the admin menu, by upload it in "Featured Image"', 'yiw')), 15 => array('id' => 'portfolio_type', 'name' => __('Layout', 'yiw'), 'type' => 'select', 'options' => $yiw_portfolio_type, 'desc' => __('Set the layout for this portfolio, that will be used in the page with the portfolio template.', 'yiw'), 'std' => ''), 16 => array('id' => 'portfolio_items', 'name' => __('Items', 'yiw'), 'type' => 'text', 'desc' => __('The number of items to show in this portfolio, when selected in the page. Leave empty to show all items.', 'yiw'), 'std' => ''), 17 => array('id' => 'portfolio_read_more', 'name' => __('Read More', 'yiw'), 'type' => 'text', 'desc' => __('The text of button to read the entire post.', 'yiw'), 'std' => __('View Project', 'yiw')), 19 => array('type' => 'sep'), 20 => array('id' => 'portfolio_rewrite', 'name' => __('Rewrite', 'yiw'), 'type' => 'text', 'desc' => __('Set the rewrite role for the posts of this portfolio (es. %s/). Leave empty to generate it automatically.', 'yiw'), 'std' => ''), 30 => array('id' => 'portfolio_label_sin', 'name' => __('Label Singular', 'yiw'), 'type' => 'text', 'desc' => __('The label that will be shown when you create the post of this portfolio.', 'yiw'), 'std' => ''), 40 => array('id' => 'portfolio_label_plu', 'name' => __('Label Plural', 'yiw'), 'desc' => __('The label that will be shown when you create the post of this portfolio.', 'yiw'), 'type' => 'text', 'std' => ''), 50 => array('type' => 'sep'), 60 => array('id' => 'portfolio_tax', 'name' => __('Taxonomy', 'yiw'), 'desc' => __("Set the taxonomy for this portfolio. Leave empty, if you don't want a taxonomy. (Don't use the same name of the portfolio name, also of others portfolios)", 'yiw'), 'type' => 'text', 'std' => ''), 70 => array('id' => 'portfolio_tax_rewrite', 'name' => __('Taxonomy rewrite', 'yiw'), 'desc' => __('Set the rewrite role for the posts of this portfolio. Leave empty to generate it automatically.', 'yiw'), 'type' => 'text', 'std' => ''));
    yiw_register_metabox('yiw_portfolio_options', __('Portfolio options', 'yiw'), 'create-portfolio', $options_args, 'normal');
    //portfolio video url
    $options_args = array(10 => array('id' => 'portfolio_video', 'name' => __('Video URL:', 'yiw'), 'type' => 'text', 'desc' => __('Here, you can add an Youtube or Vimeo url video, to show on thumb of this portfolio element.', 'yiw'), 'desc_location' => 'newline'));
    foreach (yiw_get_portfolios() as $post_type => $post_type_title) {
        yiw_register_metabox('yiw_url_portfolio_' . $post_type, __('Video URL', 'yiw'), $post_type, $options_args, 'normal', 'high');
    }
    // portfolio
    $options_args = array(10 => array('id' => 'portfolio_skills_label', 'name' => __('Skills Label', 'yiw'), 'type' => 'text', 'desc' => __('Insert the label used in skills field', 'yiw'), 'desc_location' => 'newline'), 20 => array('id' => 'portfolio_skills', 'name' => __('Skills', 'yiw'), 'type' => 'text', 'desc' => __('Insert the skills', 'yiw'), 'desc_location' => 'newline'), 30 => array('id' => 'portfolio_date_label', 'name' => __('Date label', 'yiw'), 'type' => 'text', 'desc' => __('Insert the label used in date field', 'yiw'), 'desc_location' => 'newline'), 40 => array('id' => 'portfolio_date', 'name' => __('Date', 'yiw'), 'type' => 'text', 'desc' => __('Insert the date', 'yiw'), 'desc_location' => 'newline'));
    foreach (yiw_get_portfolios() as $post_type => $post_type_title) {
        yiw_register_metabox('yiw_portfolio_skillsdate_' . $post_type, __('Skills and Date', 'yiw'), $post_type, $options_args, 'normal', 'high');
    }
}
Esempio n. 2
0
<?php

/**
 * Register theme metaboxes.     
 * 
 * @package WordPress
 * @subpackage YIW Themes
 * @since 1.0
 */
// subtitle slogan
$options_args = array(11 => array('id' => 'subslogan_page', 'name' => __('Slogan Subtitle', 'yiw'), 'type' => 'text', 'desc' => __('Insert the subtitle of slogan showed below the main title of this slogan.', 'yiw'), 'desc_location' => 'newline'));
yiw_add_options_to_metabox('yiw_slogan_page', $options_args);
//testimonial url
$options_args = array(10 => array('id' => 'testimonial_label', 'name' => __('Web Site Label', 'yiw'), 'type' => 'text', 'desc' => __('Insert the label used for Testimonial Website Url', 'yiw'), 'desc_location' => 'newline'), 20 => array('id' => 'testimonial_website', 'name' => __('Web Site URL', 'yiw'), 'type' => 'text', 'desc' => __('Insert the url referred to Testimonial', 'yiw'), 'desc_location' => 'newline'));
yiw_register_metabox('yiw_url_testimonial', __('Website Testimonial', 'yiw'), 'bl_testimonials', $options_args, 'normal', 'high');
//Testimonial checkbox that allows link to the extended page
$options_args = array(1 => array('id' => 'testimonial_link', 'name' => __('Allow Link', 'yiw'), 'type' => 'checkbox', 'desc' => __('Allow link to the testimonial page', 'yiw'), 'desc_location' => 'newline'));
yiw_register_metabox('yiw_allow_link_testimonial', __('Allow Link Testimonial', 'yiw'), 'bl_testimonials', $options_args, 'normal', 'high');
//show breadcrumbs
global $yiw_sliders;
$options_args = array(21 => array('id' => 'show_breadcrumbs_page', 'name' => __('Show Breadcrumbs below the title', 'yiw'), 'type' => 'radio', 'options' => array('yes' => __('Yes', 'yiw'), 'no' => __('No', 'yiw')), 'std' => 'yes'), 80 => array('id' => 'slider_type', 'name' => __('Select a slider for this page', 'yiw'), 'type' => 'select', 'hidden' => false, 'options' => $yiw_sliders, 'std' => 'none'), 99 => array('id' => 'portfolio_post_type', 'name' => __('Portfolio', 'yiw'), 'desc' => __('NB: valid only for the portfolio template', 'yiw'), 'type' => 'select', 'options' => yiw_get_portfolios()));
yiw_add_options_to_metabox('yiw_options_page', $options_args);
// add map
$options_args = array(10 => array('id' => 'show_map', 'name' => __('Show Map', 'yiw'), 'type' => 'radio', 'options' => array('yes' => __('Yes', 'yiw'), 'no' => __('No', 'yiw')), 'std' => 'no'), 20 => array('id' => 'map_url', 'name' => __('Link src', 'yiw'), 'type' => 'text', 'desc' => __('The link of the map, get from Google Maps.', 'yiw')), 30 => array('id' => 'map_opened', 'name' => __('Open the map at page loaded.', 'yiw'), 'type' => 'select', 'options' => array('yes' => __('Yes', 'yiw'), 'no' => __('No', 'yiw')), 'std' => 'no', 'desc' => __('Say if you want the map opened when the page is loaded.', 'yiw'), 'desc_location' => 'inline'));
yiw_register_metabox('yiw_map_page', __('Tab with map', 'yiw'), 'page', $options_args, 'normal', 'high');