Advertisement
Guest User

Untitled

a guest
Nov 28th, 2016
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. /* Prevents problems with websites where META BOX Plugin is not installed */
  2.  
  3. if ( ! function_exists( 'rwmb_meta' ) ) {
  4.     function rwmb_meta( $key, $args = '', $post_id = null ) {
  5.         return false;
  6.     }
  7. }
  8.  
  9. /*
  10. Adds a custom meta box for the META BOX Plugin
  11. Plugin URL: http://wordpress.org/plugins/meta-box/
  12. */
  13.  
  14. add_filter( 'rwmb_meta_boxes', 'reviewer_ilovewp_meta_boxes' );
  15.  
  16. function reviewer_ilovewp_meta_boxes( $meta_boxes ) {
  17.     $meta_boxes[] = array(
  18.             'title'      => __( 'Custom Post Meta', 'reviewer' ),
  19.             'post_types' => 'post',
  20.             'fields'     => array(
  21.         array(
  22.             'id'   => 'product-rating',
  23.             'name' => __( 'Product Rating', 'reviewer' ),
  24.             'type' => 'text',
  25.         ),
  26.         array(
  27.             'id'   => 'product-price',
  28.             'name' => __( 'Product Price', 'reviewer' ),
  29.             'type' => 'text',
  30.         ),
  31.         array(
  32.             'id'   => 'product-profile',
  33.             'name' => __( 'Product Profile', 'reviewer' ),
  34.             'type' => 'textarea',
  35.         ),
  36.         ),
  37.     );
  38.     return $meta_boxes;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement