'default', 'name' => __( 'SideBar - Home', 'ADA' ), 'description' => __( 'Site Homepage', 'ADA' ) ) ); register_sidebar( array( 'id' => 'paginas', 'name' => __( 'SideBar - Pages', 'ADA' ), 'description' => __( 'Itens to show in Pages', 'ADA' ) ) ); register_sidebar( array( 'id' => 'postagens', 'name' => __( 'SideBar - Posts', 'ADA' ), 'description' => __( 'Itens to show in Posts', 'ADA' ) ) ); register_sidebar( array( 'id' => 'categoria', 'name' => __( 'SideBar - Categories', 'ADA' ), 'description' => __( 'Itens to show in Categories Listings', 'ADA' ) ) ); register_sidebar( array( 'id' => 'pesquisa', 'name' => __( 'SideBar - Search Results', 'ADA' ), 'description' => __( 'Search Results, 404 etc', 'ADA' ) ) ); register_sidebar( array( 'id' => 'box-e', 'name' => __( 'Footer - Left Box', 'ADA' ), 'description' => __( 'The left area in Footer', 'ADA' ) ) ); register_sidebar( array( 'id' => 'box-c', 'name' => __( 'Footer - Center Box', 'ADA' ), 'description' => __( 'The center area in Footer', 'ADA' ) ) ); register_sidebar( array( 'id' => 'box-d', 'name' => __( 'Footer - Right Box', 'ADA' ), 'description' => __( 'The right area in Footer', 'ADA' ) ) ); } if ( ! isset( $content_width ) ) $content_width = 900; add_theme_support( 'post-thumbnails' ); add_editor_style(); add_custom_background(); add_theme_support( 'automatic-feed-links' ); add_theme_support('menus'); register_nav_menus( array( 'menu-topo' => __('Navigation Menu
Add Pages, Categories, etc. You can use nested itens as well.', 'ADA') , 'menu-intro' => __('Intro Menu
Add up to 6 itens like special pages, links etc . Nested itens are not supported!', 'ADA') , 'menu-rodape' => __('Footer Menu
Add Privacy Policy, Legal Notes, Terms of Service etc', 'ADA') ) ); add_image_size( 'intro', 230, 230, true ); define('NO_HEADER_TEXT', true ); define('HEADER_TEXTCOLOR', ''); define( 'HEADER_IMAGE', '%s/img/logo.png' ); define( 'HEADER_IMAGE_WIDTH', apply_filters( 'ADA_admin_header_image_width', 500 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'ADA_admin_header_image_height', 150 ) ); add_custom_image_header( '', 'ADA_admin_header_style' ); if ( ! function_exists( 'ADA_admin_header_style' ) ) : function ADA_admin_header_style() { ?> __('Animals for Adoption','ADA'), 'singular_name' => _x('Animal', 'post type singular name', 'ADA'), 'add_new' => __('Add Animal', 'ADA'), 'add_new_item' => __('Add animal for Adoption', 'ADA'), 'edit_item' => __('Edit Animal', 'ADA'), 'new_item' => __('New Animal', 'ADA'), 'view_item' => __('View Animal', 'ADA'), 'search_items' => __('Search for Animal', 'ADA'), 'not_found' => __('Not Found!','ADA'), 'not_found_in_trash' => __('Nothing found in Trash','ADA'), 'parent_item_colon' => '', 'menu_name' => __('Animals', 'ADA') ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => 100, 'show_in_nav_menus'=> false, 'supports' => array('title','editor','thumbnail','comments') ); register_post_type('pet',$args); } $labels = array( 'name' => __( 'Types', 'ADA'), 'singular_name' => _x('Type', 'post type singular name', 'ADA'), 'search_items' => __( 'Search', 'ADA' ), 'popular_items' => __( 'Most Used', 'ADA' ), 'all_items' => __( 'All Types', 'ADA' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add Type', 'ADA' ), 'update_item' => __( 'Update Type', 'ADA' ), 'add_new_item' => __( 'Add new Type', 'ADA' ), 'new_item_name' => __( 'New Type', 'ADA' ) ); register_taxonomy('type', array('pet'), array( 'hierarchical' => true, 'labels' => $labels, 'singular_label' => __( 'Type', 'ADA'), 'all_items' => __( 'All Types', 'ADA' ), 'query_var' => true, 'rewrite' => array( 'slug' => 'type' )) ); $labels = array( 'name' => __( 'Colors','ADA'), 'singular_name' => _x('Color', 'post type singular name', 'ADA'), 'search_items' => __( 'Search Colors','ADA'), 'all_items' => __( 'All Colors','ADA'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add new Color','ADA'), 'update_item' => __( 'Update Color','ADA'), 'add_new_item' => __( 'Add Color','ADA'), 'new_item_name' => __( 'New Color','ADA') ); register_taxonomy('color', array('pet'), array( 'hierarchical' => false, 'labels' => $labels, 'singular_label' => 'Status', 'all_items' => __('All Colors' ,'ADA'), 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => array( 'slug' => 'color' )) ); $labels = array( 'name' => __( 'Status','ADA'), 'singular_name' => __( 'Status','ADA'), 'search_items' => __( 'Search Status','ADA'), 'all_items' => __( 'All Status','ADA'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add New','ADA'), 'update_item' => __( 'Update Status','ADA'), 'add_new_item' => __( 'Add Status','ADA'), 'new_item_name' => __( 'New Status' ,'ADA') ); register_taxonomy('status', array('pet'), array( 'hierarchical' => false, 'labels' => $labels, 'singular_label' => 'Status', 'all_items' => __('All Status','ADA'), 'query_var' => true, 'rewrite' => array( 'slug' => 'status' )) ); add_action('init', 'perdidos_register'); function perdidos_register() { $labels = array( 'name' => __('Lost Pets','ADA'), 'singular_name' => _x('Lost Pet', 'post type singular name', 'ADA'), 'add_new' => __('Add Lost Pet','ADA'), 'add_new_item' => __('Add Lost Pet','ADA'), 'edit_item' => __('Edit Pet','ADA'), 'new_item' => __('New Pet','ADA'), 'view_item' => __('View Pet','ADA'), 'search_items' => __('Search Pet','ADA'), 'not_found' => __('Not Found!','ADA'), 'not_found_in_trash' => __('Nothing found in Trash','ADA'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 100, 'has_archive' => true, 'supports' => array('title','editor','comments') ); register_post_type( 'lost' , $args ); } $labels = array( 'name' => __( 'Types','ADA'), 'singular_name' => _x('Type', 'post type singular name', 'ADA'), 'search_items' => __( 'Search' ,'ADA'), 'popular_items' => __( 'Most Popular','ADA'), 'all_items' => __( 'All Types','ADA'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add New','ADA'), 'update_item' => __( 'Update','ADA'), 'add_new_item' => __( 'Add new Type','ADA'), 'new_item_name' => __( 'New Type','ADA') ); register_taxonomy('lost-type', array('lost'), array( 'hierarchical' => true, 'labels' => $labels, 'singular_label' => __('Pet Types', 'ADA'), 'all_items' => __('All Types', 'ADA'), 'query_var' => true, 'show_in_nav_menus' => false) ); add_action('init', 'noticias_register'); function noticias_register() { $labels = array( 'name' => __('News','ADA'), 'singular_name' => __('News','ADA'), 'add_new' => __('Add News','ADA'), 'add_new_item' => __('Add News','ADA'), 'edit_item' => __('Edit News','ADA'), 'new_item' => __('Add News','ADA'), 'view_item' => __('View News','ADA'), 'search_items' => __('Search News','ADA'), 'not_found' => __('Not Found','ADA'), 'not_found_in_trash' => __('Nothing found in Trash','ADA'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 100, 'show_in_nav_menus'=> false, 'has_archive' => true, 'supports' => array('title','editor','thumbnail', 'author', 'comments') ); register_post_type( 'news' , $args ); } $labels = array( 'name' => __( 'News Tags','ADA'), 'singular_name' => _x('News Tag', 'post type singular tag', 'ADA'), 'search_items' => __( 'Search' ,'ADA'), 'popular_items' => __( 'Most Popular','ADA'), 'all_items' => __( 'All Tag News' ,'ADA'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add New' ,'ADA'), 'update_item' => __( 'Update','ADA'), 'add_new_item' => __( 'Add new Tag','ADA'), 'new_item_name' => __( 'New Tag','ADA') ); register_taxonomy('tag-news', array('news'), array( 'hierarchical' => false, 'labels' => $labels, 'singular_label' => __('News Tag', 'ADA'), 'all_items' => __('All Tags', 'ADA'), 'query_var' => true, 'show_in_nav_menus'=> false, 'rewrite' => array( 'slug' => 'tag-news' )) ); add_action('init', 'article'); function article() { $labels = array( 'name' => __('Article','ADA'), 'singular_name' => _x('Article', 'post type singular name', 'ADA'), 'add_new' => __('Add Article','ADA'), 'add_new_item' => __('Add New Article','ADA'), 'edit_item' => __('Edit Article','ADA'), 'new_item' => __('New Article','ADA'), 'view_item' => __('View Articles','ADA'), 'search_items' => __('Search for Articles','ADA'), 'not_found' => __('Not Found!','ADA'), 'not_found_in_trash' => __('Nothing found in Trash','ADA'), 'parent_item_colon' => '', 'show_in_nav_menus'=> false, 'menu_name' => __('Articles','ADA') ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => true, 'menu_position' => 100, 'show_in_nav_menus'=> false, 'supports' => array('title','editor','author','thumbnail','comments'), 'rewrite' => array( 'slug' => 'article' ) , 'has_archive' => true ); register_post_type('articles',$args); } $labels = array( 'name' => __( 'Articles Tags','ADA'), 'singular_name' => _x('Articles Tag', 'post type singular tag', 'ADA'), 'search_items' => __( 'Search' ,'ADA'), 'all_items' => __( 'All Tags' ,'ADA'), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Add New','ADA'), 'update_item' => __( 'Update','ADA'), 'add_new_item' => __( 'Add Tag','ADA'), 'new_item_name' => __( 'New Tag','ADA') ); register_taxonomy('tag-article', array('articles'), array( 'hierarchical' => false, 'labels' => $labels, 'singular_label' => 'Status', 'all_items' => __('All Tags', 'ADA'), 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => array( 'slug' => 'tag-article' )) ); //display contextual help add_action( 'contextual_help', 'add_help_text', 10, 3 ); function add_help_text($contextual_help, $screen_id, $screen) { //$contextual_help .= var_dump($screen); // use this to help determine $screen->id if ('pet' == $screen->id ) { $contextual_help = '

' . __('ADA Theme Help', 'ADA') . '

' . '

' . __('ADA Theme was designed for local or personal websites for animals adoption.', 'ADA') . '

' . '

' . __('In this screen, you can add a specif post type for available pets for adoption. All pets stores individual data such breed, colors, size and more. Learn the basics:', 'ADA') . '

' . '' . '

' . __('All posts created in this area are specific for animals availables for adoption. Please fill all fields within the Animal Info box and also these two special info:', 'ADA') . '

' . '' . '

' . __('Status info are required. These tags guides animals post type to the right layout area and also helps visitors to navigate the site content. When adding a pet for adoption, use the adopt tag, if the pet are no longer available, remove the previous tag and use adopted tag. Never use boths tag at once.', 'ADA') . '

' . '

The Animal Info box, keep all the most important informations about a pet. The more you inform, the better. All data are stored within every post type, you also can update or change data anytime.

' . '

' . __('More Help with ADA Theme:', 'ADA') . '

'. '

' . __('ADA Theme site', 'ADA') . '

' ; }elseif ( 'news' == $screen->id ) { $contextual_help = '

' . __('ADA Theme Help','ADA') . '

' . '

' . __('Create News post types and keep your visitors up do date with your project activities.', 'ADA') . '

' . '

' . __('The News post type, can be useful for inform about events in your town related do animals adoption and so on. All News post types are kept in the same place, without categories, so you can focus on adding news.', 'ADA') . '

' . '

' . __('More Help with ADA Theme:', 'ADA') . '

'. '

' . __('ADA Theme site', 'ADA') . '

' ; } elseif ( 'articles' == $screen->id ) { $contextual_help = '

' . __('ADA Theme Help', 'ADA') . '

' . '

' . __('Create Articles post types for special content, interviews and alike', 'ADA') . '

' . '

' . __('The Article post type is designed for anyt content related to your site. Using Articles prevents creating categories for few or single posts only. Article post types can be commented or not and also supports tags.', 'ADA') . '

' . '

' . __('More Help with ADA Theme:', 'ADA') . '

'. '

' . __('ADA Theme site', 'ADA') . '

' ; } elseif ( 'lost' == $screen->id ) { $contextual_help = '

' . __('ADA Theme Help', 'ADA') . '

' . '

' . __('ADA Theme also can help displaying lost pets.', 'ADA') . '

' . '

' . __('The site Admin can allow visitors to create this post type (Contributor user level).', 'ADA') . '

' . '' . '

' . __('All posts created in this area are specific for lost pets. Please fill all fields within the Lost Pet Info.', 'ADA') . '

' . '

The Lost Pet Info box, keep all the most importante informations about a lost pet. The more you inform, the better. All data are stored within every post type, you also can update or change data anytime.

' . '

' . __('More Help with ADA Theme:', 'ADA') . '

'. '

' . __('ADA Theme site', 'ADA') . '

' ; } elseif ( 'edit-pet' == $screen->id || 'edit-lost' == $screen->id || 'edit-article' == $screen->id || 'edit-news' == $screen->id) { $contextual_help = '

' . __('More Help with ADA Theme:', 'ADA') . '

'. '

' . __('ADA Theme site', 'ADA') . '

' ; } return $contextual_help; } /* Metaboxes para os tipos de postagens */ $prefix = 'dbt_'; $meta_boxes = array(); // first meta box $meta_boxes[] = array( 'id' => 'my-meta-box-1', 'title' => __('Animal Info', 'ADA'), 'pages' => array('pet'), // multiple post types 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'type' => 'h4', 'std' => __(' Informations', 'ADA') ), array( 'type' => 'p', 'std' => __('Add some important information for each animal, filling the form below. All data can be changed or updated anytime and are stored individually.', 'ADA') ), array( 'name' => __('Gender', 'ADA'), 'id' => $prefix . 'genero', 'type' => 'radio', 'options' => array( array('name' => __('Female', 'ADA'), 'value' => __('Female', 'ADA')), array('name' => __('Male', 'ADA'), 'value' => __('Male', 'ADA')), array('name' => __('Females & Males', 'ADA'), 'value' => __('Females & Males', 'ADA')) ) ), array( 'name' => __('Spayed/Neutered', 'ADA'), 'id' => $prefix . 'cast', 'type' => 'radio', 'desc' => 'dd', 'options' => array( array('name' => __('Yes', 'ADA'), 'value' => __('Yes', 'ADA')), array('name' => __('No', 'ADA'), 'value' => __('No', 'ADA')) ) ), array( 'name' => __('Age', 'ADA'), 'id' => $prefix . 'idade', 'type' => 'select', 'options' => array(__('Baby (Under 1 year)', 'ADA'),__('Adult (2 to 9 years)', 'ADA'), __('Senior (More than 10 years)', 'ADA') ) ), array( 'name' => __('Breed(s)', 'ADA'), 'desc' => 'One or more breeds separated by commas. Example: Poodle, Unknown', 'id' => $prefix . 'raca', 'type' => 'text', 'std' => '' ), array( 'name' => __('Size', 'ADA'), 'id' => $prefix . 'porte', 'type' => 'select', 'options' => array(__('Newborn (Imprecise)', 'ADA'),__('Mini', 'ADA'), __('Small', 'ADA'), __('Medium', 'ADA'),__('Large', 'ADA'), __('Huge', 'ADA') ) ), array( 'name' => __('Hair', 'ADA'), 'id' => $prefix . 'pelagem', 'type' => 'select', 'options' => array(__('Short', 'ADA'),__('Medium', 'ADA'), __('Long', 'ADA'), __('Mixed', 'ADA') ) ), array( 'name' => __('Pattern', 'ADA'), 'id' => $prefix . 'padrao', 'type' => 'select', 'options' => array(__('Solid', 'ADA'),__('Brindle', 'ADA'), __('Patches', 'ADA'), __('Spotted', 'ADA') ) ), array( 'name' => __('Vaccines', 'ADA'), 'id' => $prefix . 'vacinas', 'type' => 'radio', 'options' => array( array('name' => __('Vaccinated', 'ADA'), 'value' => __('Vaccinated', 'ADA')), array('name' => __('Unknown', 'ADA'), 'value' => __('Unknown', 'ADA')), array('name' => __('Dose Interval', 'ADA'), 'value' => __('Dose Interval', 'ADA')), array('name' => __('None', 'ADA'), 'value' => __('None', 'ADA')) ) ), array( 'name' => __('Notes (optional)', 'ADA'), 'desc' => __('Physical conditions, aspects or any other info', 'ADA'), 'id' => $prefix . 'ob', 'type' => 'textarea', 'std' => '' ), array( 'type' => 'header', 'std' => __('Contact', 'ADA'), ), array( 'type' => 'p', 'std' => __('Please Note: The following data will be visible in our website. Be careful sharing personal information such e-mails and addresses. You can create a e-mail for this purpose only, check with your favorite e-mail provider.', 'ADA') ), array( 'name' => __('Contact Info', 'ADA'), 'desc' => __('How to adopt this pet, person in charge etc.', 'ADA'), 'id' => $prefix . 'contato', 'type' => 'textarea', 'std' => '' ), array( 'name' => __('E-mail', 'ADA'), 'desc' => __('Example: name@server.com', 'ADA'), 'id' => $prefix . 'email', 'type' => 'text', 'std' => '' ) ) ); // segunda meta box $meta_boxes[] = array( 'id' => 'my-meta-box-2', 'title' => __('Lost Pet Info', 'ADA'), 'pages' => array('lost'), // custom post type 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'type' => 'h4', 'std' => __('Extra Information', 'ADA') ), array( 'type' => 'p', 'std' => __('Add extra information for each animal, using the form below. These data can be change or updated anytime and are stored individually.', 'ADA') ), array( 'name' => __('Gender', 'ADA'), 'id' => $prefix . 'p-genero', 'type' => 'radio', 'options' => array( array('name' => __('Female', 'ADA'), 'value' => __('Female', 'ADA')), array('name' => __('Male', 'ADA'), 'value' => __('Male', 'ADA')) ) ), array( 'name' => __('Spayed/Neutered', 'ADA'), 'id' => $prefix . 'p-cast', 'type' => 'radio', 'desc' => 'dd', 'options' => array( array('name' => __('Yes', 'ADA'), 'value' => __('Yes', 'ADA')), array('name' => __('No', 'ADA'), 'value' => __('No', 'ADA')) ) ), array( 'name' => __('Age', 'ADA'), 'id' => $prefix . 'p-idade', 'type' => 'select', 'options' => array(__('Baby (Under 1 year)', 'ADA'),__('Adult (2 to 9 years)', 'ADA'), __('Senior (More than 10 years)', 'ADA') ) ), array( 'name' => __('Breed(s)', 'ADA'), 'desc' => 'One or more breeds separated by commas. Example: Poodle, Unknown', 'id' => $prefix . 'p-raca', 'type' => 'text', 'std' => '' ), array( 'name' => __('Size', 'ADA'), 'id' => $prefix . 'p-porte', 'type' => 'select', 'options' => array( __('Mini', 'ADA'), __('Small', 'ADA'), __('Medium', 'ADA'),__('Large', 'ADA'), __('Huge', 'ADA') ) ), array( 'name' => __('Color(s)', 'ADA'), 'desc' => __('One or more colors separated by commas. Example: White, Walnut', 'ADA'), 'id' => $prefix . 'p-cor', 'type' => 'text', 'std' => '' ), array( 'name' => __('Hair', 'ADA'), 'id' => $prefix . 'p-pelagem', 'type' => 'select', 'options' => array(__('Short', 'ADA'),__('Medium', 'ADA'), __('Long', 'ADA'), __('Mixed', 'ADA') ) ), array( 'name' => __('Pattern', 'ADA'), 'id' => $prefix . 'p-padrao', 'type' => 'select', 'options' => array(__('Solid', 'ADA'),__('Brindle', 'ADA'), __('Patches', 'ADA'), __('Spotted', 'ADA') ) ), array( 'type' => 'header', 'std' => __('Pet\'s Pictures', 'ADA'), ), array( 'type' => 'p', 'std' => __('Use an image host service for host your images then inform direct links below:', 'ADA') ), array( 'name' => __('Picture 1', 'ADA'), 'id' => $prefix . 'p-pic1', 'type' => 'text', 'std' => 'http://', 'desc'=> __('Recomended width: 400px', 'ADA') ), array( 'name' => __('Picture 2', 'ADA'), 'id' => $prefix . 'p-pic2', 'type' => 'text', 'std' => 'http://', 'desc'=> __('Recomended width: 400px', 'ADA') ), array( 'type' => 'header', 'std' => __('Where Pet was Lost', 'ADA'), ), array( 'name' => __('Date', 'ADA'), 'desc' => __('Date lost. Format MM-DD-YYYY', 'ADA'), 'id' => $prefix . 'p-data', 'type' => 'text', 'std' => '' ), array( 'name' => __('Place & Time', 'ADA'), 'desc' => __('The last place and time. Example: Lincoln Park at 12:32 am', 'ADA'), 'id' => $prefix . 'p-rua', 'type' => 'text', 'std' => '' ), array( 'type' => 'header', 'std' => __('Contact', 'ADA'), ), array( 'type' => 'p', 'std' => __('Please Note: The following data will be visible in our website. Be careful sharing personal information such e-mails and addresses. You can create a e-mail for this purpose only, check with your favorite e-mail provider.', 'ADA') ), array( 'name' => __('Contact Info', 'ADA'), 'desc' => __('Notifying about this pet', 'ADA'), 'id' => $prefix . 'p-contato', 'type' => 'textarea', 'std' => '' ), array( 'name' => __('E-mail', 'ADA'), 'desc' => __('Example: name@server.com', 'ADA'), 'id' => $prefix . 'p-email', 'type' => 'text', 'std' => '' ) ) ); foreach ($meta_boxes as $meta_box) { $my_box = new My_meta_box($meta_box); } class My_meta_box { protected $_meta_box; // create meta box based on given data function __construct($meta_box) { $this->_meta_box = $meta_box; add_action('admin_menu', array(&$this, 'add')); add_action('save_post', array(&$this, 'save')); } /// Add meta box for multiple post types function add() { foreach ($this->_meta_box['pages'] as $page) { add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']); } } // Callback function to show fields in meta box function show() { global $post; // Use nonce for verification echo ''; echo ''; foreach ($this->_meta_box['fields'] as $field) { // get current post meta data $meta = get_post_meta($post->ID, $field['id'], true); echo '', '', ''; } echo '
'; switch ($field['type']) { case 'text': echo '', '
', '' ,$field['desc'], ''; break; case 'textarea': echo '', '
', '' ,$field['desc'], ''; break; case 'select': echo ''; break; case 'radio': foreach ($field['options'] as $option) { echo '', $option['name']; } break; case 'checkbox': echo ''; break; case 'header': echo '

', $field['std'], '

'; break; case 'p': echo '

', $field['std'], '

'; break; case 'h4': echo '

', $field['std'], '

'; break; } echo '
', '
'; } // Save data from meta box function save($post_id) { // verify nonce if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) { return $post_id; } // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } // check permissions if ('page' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) { return $post_id; } } elseif (!current_user_can('edit_post', $post_id)) { return $post_id; } foreach ($this->_meta_box['fields'] as $field) { $old = get_post_meta($post_id, $field['id'], true); $new = $_POST[$field['id']]; if ($new && $new != $old) { update_post_meta($post_id, $field['id'], $new); } elseif ('' == $new && $old) { delete_post_meta($post_id, $field['id'], $old); } } } } /* Funcao para comentarios*/ function ada_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • id="li-comment-">
    comment_approved == '0' ) : ?>
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • Pingaback:

    set( 'author', $current_user->id ); } } } add_filter('parse_query', 'ada_parse_query_useronly' ); ?>