YOUR_PREFIX_register_meta_boxes

The Evolved YOUR PREFIX register meta boxes function.

Description

YOUR_PREFIX_register_meta_boxes(); 

Usage

  1. if ( !function_exists( 'YOUR_PREFIX_register_meta_boxes' ) ) { 
  2. require_once '/meta-box/demo/all-custom-post-types.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = YOUR_PREFIX_register_meta_boxes(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/meta-box/demo/all-custom-post-types.php  
  1. function YOUR_PREFIX_register_meta_boxes() 
  2. if ( ! class_exists( 'RW_Meta_Box' ) ) 
  3. return; 
  4.  
  5. $prefix = 'YOUR_PREFIX_'; 
  6. $meta_boxes = array(); 
  7.  
  8. $post_types = get_post_types(); 
  9.  
  10. // 1st meta box 
  11. $meta_boxes[] = array( 
  12. 'id' => 'personal',  
  13. 'title' => 'Personal Information',  
  14. 'pages' => $post_types,  
  15.  
  16. 'fields' => array( 
  17. array( 
  18. 'name' => 'Full name',  
  19. 'id' => $prefix . 'fname',  
  20. 'type' => 'text',  
  21. ),  
  22. // Other fields go here 
  23. ); 
  24. // Other meta boxes go here 
  25.  
  26. foreach ( $meta_boxes as $meta_box ) 
  27. new RW_Meta_Box( $meta_box );