Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
- function your_prefix_register_meta_boxes( $meta_boxes ) {
- $post_type = $post_author = $post_date = '';
- $post_id = isset( $_GET['post'] ) ? (int) $_GET['post'] : null;
- if ( $post_id ) {
- $post = get_post( $post_id );
- $post_type = $post->post_type;
- $post_author = $post->post_author;
- $post_date = date( 'Y-m-d', strtotime( $post->post_date ) );
- }
- $prefix = '';
- $meta_boxes[] = array (
- 'title' => esc_html__( 'Campos de filtración', 'text-domain' ),
- 'id' => 'campos-de-filtracion',
- 'post_types' => array(
- 0 => 'noticias',
- 1 => 'articulos',
- 2 => 'cuentos',
- 3 => 'estudios',
- 4 => 'regalos',
- 5 => 'encuestas',
- 6 => 'ejercicios-web',
- 7 => 'podcasts',
- 8 => 'webcasts',
- 9 => 'seminarios-web',
- 10 => 'reciclados',
- ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'fields' => array(
- array (
- 'id' => $prefix . 'text_sfzlrrqoz5d',
- 'type' => 'text',
- 'name' => esc_html__( 'Tipo de publicación', 'text-domain' ),
- 'required' => 1,
- 'query_args' => array(
- 'std' => '',
- ),
- ),
- array (
- 'id' => $prefix . 'date_1cpjomreww5',
- 'type' => 'date',
- 'name' => esc_html__( 'Fecha de publicación', 'text-domain' ),
- 'required' => 1,
- 'std' => '',
- ),
- array (
- 'id' => $prefix . 'user_75nelpiq4a',
- 'type' => 'user',
- 'name' => esc_html__( 'Autor de la publicación', 'text-domain' ),
- 'field_type' => 'select_advanced',
- 'multiple' => true,
- 'required' => 1,
- 'query_args' => array(
- 'std' => '',
- ),
- ),
- ),
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement