Get the value set by the metabox
-
I have created this Metabox:
add_filter( 'rwmb_meta_boxes', 'cpt_opinion_register_meta_boxes' ); function cpt_opinion_register_meta_boxes( $meta_boxes ) { $prefix = 'cpt_opinion_'; $meta_boxes[] = array( 'id' => 'show_at_home', 'title' => __( 'Opciones' ), 'pages' => array( 'opinion' ), 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => __('Mostrar opinión en portada'), 'id' => $prefix.'show_at_home', 'type' => 'checkbox' ), ) ); return $meta_boxes; }
Now I need to find each
opinion
$normal_args = array( 'ignore_sticky_posts' => 1, 'order' => 'desc', 'meta_query' => array( array( 'key' => '_custom_blog_enhome', 'value' => '1', 'compare' => '=' ) ), 'post_status' => 'publish', 'posts_per_page' => 6, 'post_type' => array('post','opinion','especiales','clasificados','portadadeldia','anunciantes') ); $normal_query = new WP_Query( $normal_args );
How do I get the value set by the metabox in order to pass to the
$normal_args
parameters?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Get the value set by the metabox’ is closed to new replies.