Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Registering meta boxes
- *
- * All the definitions of meta boxes are listed below with comments.
- * Please read them CAREFULLY.
- *
- * You also should read the changelog to know what has been changed before updating.
- *
- * For more information, please visit:
- * @link http://www.deluxeblogtips.com/meta-box/docs/define-meta-boxes
- */
- /********************* META BOX DEFINITIONS ***********************/
- /**
- * Prefix of meta keys (optional)
- * Use underscore (_) at the beginning to make keys hidden
- * Alt.: You also can make prefix empty to disable it
- */
- // Better has an underscore as last sign
- $prefix = 'YOUR_PREFIX_';
- global $meta_boxes;
- $meta_boxes = array();
- $meta_boxes[] = array(
- 'id' => 'yurt',
- 'title' => 'Yurt bilgileri',
- 'pages' => array( 'post' ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array(
- 'name' => 'Özel üye',
- 'id' => 'ozel-uye',
- 'type' => 'checkbox_list',
- 'options' => array(
- 'manset' => 'Manşet',
- 'vitrin' => 'Vitrin',
- ),
- ),
- array(
- 'name' => 'Adres',
- 'id' => 'adres',
- 'type' => 'textarea',
- 'cols' => '40',
- 'rows' => '3',
- ),
- array(
- 'name' => 'Telefon',
- 'id' => 'telefon',
- 'type' => 'textarea',
- 'cols' => '40',
- 'rows' => '3',
- ),
- array(
- 'name' => 'Web site',
- 'id' => 'web-site',
- 'type' => 'text',
- 'desc' => 'Başında <code>http://</code> olmadan ekleyiniz!',
- ),
- array(
- 'name' => 'Cinsiyet',
- 'id' => 'cinsiyet',
- 'type' => 'radio',
- 'options' => array(
- 'Erkek' => 'Erkek',
- 'Kız' => 'Kız',
- )
- ),
- array(
- 'name' => 'Yurt logo',
- 'id' => 'yurt-logo',
- 'type' => 'plupload_image',
- 'max_file_uploads' => 1,
- ),
- array(
- 'name' => 'Yurt özellikleri',
- 'id' => 'yurt-ozellikleri',
- 'type' => 'wysiwyg',
- 'std' => '<ul><li>Etüd Odası</li><li>TV Salonu</li></ul>',
- ),
- )
- );
- /********************* META BOX REGISTERING ***********************/
- /**
- * Register meta boxes
- *
- * @return void
- */
- function YOUR_PREFIX_register_meta_boxes()
- {
- global $meta_boxes;
- // Make sure there's no errors when the plugin is deactivated or during upgrade
- if ( class_exists( 'RW_Meta_Box' ) )
- {
- foreach ( $meta_boxes as $meta_box )
- {
- new RW_Meta_Box( $meta_box );
- }
- }
- }
- // 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', 'YOUR_PREFIX_register_meta_boxes' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement