Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- teste usando a classe de criação de metaboxes do Deluxe Blog Tips, que foi melhorado e transformado em plugin, atualizado para a versão 3.3 do WP
- Baixe e instale o plugin: http://www.deluxeblogtips.com/meta-box
- */
- global $meta_boxes_pages;
- $meta_boxes_pages = array();
- $meta_boxes_pages[] = array(
- 'id' => 'mb_upload_banners',
- 'title' => 'Upload banners',
- 'pages' => array( 'page' ), //só vai aparecer na criação de páginas! ehehe Use 'post', 'custom post type' ... para definir onde quer que apareça
- 'fields' => array(
- array(
- 'name' => 'Banners (plupload)',
- 'desc' => 'Utilize este campo para definir quais banners aparecerão nesta página',
- 'id' => 'mb_banners',
- 'type' => 'plupload_image' // Field type: plupload image upload
- )
- )
- );
- // Hook to 'admin_init' to make sure the meta box class is loaded before (in case using the meta box class in another plugin)
- // This is also helpful for some conditionals like checking page template, categories, etc.
- add_action( 'admin_init', 'register_banner_meta_boxes' );
- /**
- * Register meta boxes
- *
- * @return void
- */
- function register_banner_meta_boxes()
- {
- global $meta_boxes_pages;
- // Make sure there's no errors when the plugin is deactivated or during upgrade
- if ( class_exists( 'RW_Meta_Box' ) )
- {
- foreach ( $meta_boxes_pages as $meta_box )
- {
- new RW_Meta_Box( $meta_box );
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment