reduxredux-frameworkpost-type

how to get product list with redux framework in wordpress option in select dropdown


I am using the redux framework and I want to use the select section as drpwdown and display the list of products, but I don't know how to call the products? Show products in the dropdown list

$fields = array(
        'id' => 'creations_pro_id',
        'type' => 'select',
        'data'     => 'post_type',
        'args'      => array(
            'post_type' => 'product',
        )
    ),

Solution

  • This is another way:

    $fields = array(
        'id'    => 'opt-select-post',
        'type'  => 'select', 
        'data'  => 'posts',
        'args'  => array(
            'post_type'      => 'product',
            'posts_per_page' => -1,
            'orderby'        => 'title',
            'order'          => 'ASC',
        )
    );
    

    This method also works correctly