Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
- function your_prefix_register_meta_boxes( $meta_boxes ) {
- $prefix = '';
- $meta_boxes[] = [
- 'title' => esc_html__( 'Header image info', 'nr' ),
- 'id' => 'header-image-info',
- 'post_types' => ['post', 'page'],
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => [
- [
- 'id' => $prefix . 'bgpos_horiz',
- 'type' => 'number',
- 'name' => esc_html__( 'x postion (%)', 'nr' ),
- 'size' => 3,
- 'tab' => 'position',
- ],
- [
- 'id' => $prefix . 'bgpos_vert',
- 'type' => 'number',
- 'name' => esc_html__( 'y position (%)', 'nr' ),
- 'size' => 3,
- 'tab' => 'position',
- ],
- [
- 'id' => $prefix . 'img_attr',
- 'type' => 'text',
- 'name' => esc_html__( 'Image attribution', 'nr' ),
- 'size' => 30,
- 'tab' => 'attribution',
- ],
- [
- 'id' => $prefix . 'img_src_url',
- 'type' => 'text',
- 'name' => esc_html__( 'Source URL', 'nr' ),
- 'tab' => 'attribution',
- ],
- ],
- ];
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement