我正在使用 META BOX 插件,我创建了复选框,但无法获取复选框的值


add_filter( 'rwmb_meta_boxes', 'your_prefix_meta_boxes' );
function your_prefix_meta_boxes( $meta_boxes ) {
    $meta_boxes[] = array(
        'title'      => __( 'Custom theme 2 Metabox ', 'textdomain' ),
        'post_types' => array('page'),
        'fields'     => array(
            array(
                'id'   => 'htitle',
                'name' => __( 'Home Page Title ', 'textdomain' ),
                'type' => 'text',
            ),
            array(
                'id'      => 'titlecss',
                'name'    => __( 'Title CSS', 'textdomain' ),
                'type'    => 'checkbox',
                'desc' => __( 'CSS For "WELCOME TO"', 'your-prefix' ),
                ), 
            array(
                'id'      => 'titlecss2',
                'name'    => __( 'Title CSS2', 'textdomain' ),
                'type'    => 'checkbox',
                'desc' => __( 'CSS For "Company name"', 'your-prefix' ),
                ),               
        ),
    );
    return $meta_boxes;
}

帮助获取复选框值我得到了这样的文本框的值

<?php echo rwmb_meta( 'htitle' ); ?>

但我无法获取复选框的值,请帮助

<?php echo rwmb_meta( 'titlecss' ); ?

我通过使用复选框的ID得到它

最新更新